I never saw this before – I wanted to make a configuration parameters Datagrid on a cpu load gauge.
I could get the Datagrid values to edit and change, but the changes did NOT propagate back to the actual object data.
I found a teeny-weeny line buried down in a StackOverflow post from a year ago that mentioned an additional parameter on the Binding tag:
I had to tell it when to push the changes back to the object. I thought just saying Mode=TwoWay (for classes that derive from INotifyPropertyChanged) was enough.
The choices for UpdateSourceTrigger are
- Default (this is usually ‘LostFocus’ )
I made mine PropertyChanged because the values are short and the user might not tab-out before clicking ‘Apply’.
But each single-letter change in the TextBox is echoed back at the ConfigItems object.