Wpf usercontrol binding not updating
And by the way, you are confusing source and target values in your question, here the functionality you want is to update the Target Value which is the property where your Text Box.
property in WPF is extremely handy, because it is automatically inherited by all children of the element where you assign it; therefore you don’t need to set it again on each element you want to bind.
But I’m not going to give up so soon, at least not while there are other options to consider 😉 The solution to our problem is actually quite simple, and takes advantage of the even when they’re not in the visual or logical tree.
I don’t know the exact mechanism that enables this behavior, but we’re going to take advantage of it to make our binding work…
So far in this tutorial, we have mostly created bindings between UI elements and existing classes, but in real life applications, you will obviously be binding to your own data objects.
Let’s illustrate with a simple example: we want to display a list of products in a System. Data Error: 2 : Cannot find governing Framework Element or Framework Content Element for target element.
Binding Expression: Path=Show Price; Data Item=null; target element is ‘Data Grid Text Column’ (Hash Code=32685253); target property is ‘Visibility’ (type ‘Visibility’) But none of these workarounds seems to work, we always get the same result…This is the price you will have to pay if you want to bind to your own classes and have the changes reflected in the UI immediately.