I do not understand error message ‘Binding cannot be changed after is has been used.’
I have 2 textboxes that I need to find in a WPF grid. I’ve found both of them. I then bind the the textboxes to properties in a class that uses INotifyPropertyChanged. The first textbox binds correctly. The second does not. I tried creating a new second text box and binding it to the original 2nd textbox property. I now receive error ‘Binding cannot be changed after it has been used’. I tried clearing the binding using ‘BindingOperations.ClearAllBindings(textBox02)’ but still get the error. I deleted the 2nd textbox and created another. It ran once without the error and then the error reappeared.
How to add IValueConverter to an existing Binding
has the same problem. I tried creating a new binding but get the same error on 2nd run.
I’m very new to WFP. I don’t know if the error is telling me that I need to use a new binding, bind to a different property, or replace the textbox. I’ve tried all three and still have the problem. Code for the various areas are below.
Thanks in advance,
Rod McKay
Binding by ElementName/RelativeSource fails on ListBox but works on items inside it
I have a simple WPF test app. It is a Window
with a Grid
, holding a ListBox
showing Image
elements. When I first ran it, the images expanded past the boundaries of the Window, so I bound their MaxWidth
property to the Window’s ActualWidth
. This worked whether I bound by ElementName
or RelativeSource
WPF – callback for when a control is getting updated after Visibility property changed
I need to figure when a control gets displayed as I set its visibility to visible
When binding text to textbox value not updated
I have the following property but the set is not called when changing the TextBox text in the ui, OnTextChanged does get called.