Reputation: 12832
I have a text box declared in xaml that uses databinding to a string property. How do I disable and then re-enable binding in code?
Thanks!
Upvotes: 1
Views: 291
Reputation: 564861
You can use BindingOperations.ClearBinding to remove a binding, and BindingOperations.SetBinding to add it back in.
Upvotes: 3
Reputation: 30418
I'm not sure if it would work or not, but you could try calling FrameworkElement.SetBinding(), and pass null
for the second parameter.
Upvotes: 0