Wpf itemssource not updating

6854933580_2c8b688306_z

Default is, obviously, the default value of the Update Source Trigger.The other options are Property Changed, Lost Focus and Explicit.Try running the example on your own machine and see how the three textboxes act completely different: The first value doesn't update before you click the button, the second value isn't updated until you leave the Text Box, while the third value updates automatically on each keystroke, text change etc.

As of writing, all properties except for the Text property, is updated as soon as the property changes (Property Changed), while the Text property is updated when focus on the destination element is lost (Lost Focus).

I can then remove an item from the m_Variable List collection, and it does not disappear from the List Box. I used the same XAML successfully in a test application; however, I was able to replicate the issue you are experiencing by re-instantiating the m_Variable List variable.

When the m_Variable List is given a new instance, or pointed to a new object, it is not reflected in the List Box because the control has its own reference to the data.

I'm setting this Items Source of the List Box programmatically: When I initially set the Items Source, the List Box (which is not visible at the time) gets its items set.

However, if I go view the List Box, updates seem to stop at that point. The problem is not in the XAML that you have provided.

It means that the source value will be updated each time the destination control loses focus.

You must have an account to comment. Please register or login here!