Change binding value, not binding itself
- by Sam
I've got a WPF UserControl containing a DependencyProperty (MyProperty).
The DependencyProperty is bound to a Property in the DataContext.
Now in the UserControl I want to change the value of the bound property. But if I assign MyProperty = NewValue the Binding is lost and replaced by NewValue.
What I want to achieve is change the DataContext-property the DependencyProperty is bound to.
How do I achieve this instead of changing the binding?
To clarify: using something like MyTextBox.Text = "0"; I'll release the binding. How would I set Text, leave the binding intact so the property Text is bound to will change, too.