Wpf datatemplate binding not updating

by  |  09-Dec-2019 15:24

That may lead to a counterintuitive situation when you want to specify some UI element content and then use bindings in that content.Let's take an example: I realize this is not what most of you have in mind when using a Content Control.

wpf datatemplate binding not updating-13

Then there are some problems (like this and this) where WPF leaks for you too.

Finally, there are things (this, this, this, this, this, and this) that simply perform worse than you likely expect.

A quick post here about using a Content Presenter (or a Content Control which uses a Content Presenter in its template) with its Content property.

The intended usage of Content Presenter is to set the Content to some binding to a data object, then control the element tree via the Content Template property.

Conversely, user controls cannot be templated as the XAML is embedded. Net developer then you will likely start with simple CLR properties. Like this: Setting such a property is a snap, and it works just fine. A data binding target MUST be a dependency property.

Community Discussion