Wpf dependency property not updating
But I don't mind refactoring if things can be done better.Well, you have several options, you can create an event in Paint Object, and subscribe from dependency property change, you can bind to all properties by code, using Binding Operations, you can clone Poin Object as you did [email protected], hard to do recommendations without having hole logic in mind.
Your console trace should be in there, not in the setter.Then I did a model and implemented the On Property Changed and used the control in Main Window.When I click the Browse button in the User Control the Dependency Property "File Path" is correctly set (and the textbox gets the path string) but the model doesn't seem to work.I have bound the Name property to Text property of Text View.All I need to do is, on the button click I want to update the Name value that will have to update the text box value.Empty, new Property Changed Callback(On File Path Property Changed)) ); @Anatoliy Nikolaev I have mentioned to add Update Source Trigger to the User Control itself instead adding it while using(as you said).
And I think adding the Update Source Trigger while using it, doesn't work.
I know my bound data is sending proper INotify events because I can bind other controls to the data like textblocks and see its content change as the objects property changes, but my user control does not seem to be receiving the event at all. The WPF Framework will not call them, it will use the dependency property directly.
Never do anything in those getters and setters that you need to get done.
I thought, if I use dependency property instead of normal CLR property, I dont need to implement INotify Property Changed.
But the value in the UI is not updating as expected.
The code for those properties in control is pretty much copy-paste, so I doubt problem is there.