WPF dependency property setter not firing when PropertyChanged is fired, but source value is not cha
- by Sandor Davidhazi
I have an int dependency property on my custom Textbox, which holds a backing value. It is bound to an int? property on the DataContext.
If I raise the PropertyChanged event in my DataContext, and the source property's value is not changed (stays null), then the dependency property's setter is not fired.
This is a problem, because I want to update the custom Textbox (clear the text) on PropertyChanged, even if the source property stays the same. However, I didn't find any binding option that does what I want (there is an UpdateSourceTrigger property, but I want to update the target here, not the source).
Maybe there is a better way to inform the Textbox that it needs to clear its text, I'm open to any suggestions.