I have an ObservableCollection <Foo> which is associated with an ItemsControl (basically displays a list).
Foo basically looks like this (there are other members, but it does not implement any interfaces or events):
class Foo
{
public string Name { get; set; }
}
When the user clicks on an item, I open a dialog box in which the user can edit the Foo properties (tied to a small view model using the Foo property for the selected item), Xaml looks like this:
<TextBox Text="{Binding Foo.Name,Mode=TwoWay}"
Grid.Column="1" Grid.Row="0" Margin="2" />
It's really strange when a user edits a name, the value in the list changes! (not during input, but after the focus leaves the field)
How it's done? I did not implement the INotifyPropertyChanged interface on a Foo object!
, - . , , , .
: casperOne ! , 404:
[..] WPF, WPF PropertyDescriptor, , CLR INotifyPropertyChanged . PropertyDescriptor.AddValueChanged(). , , , PropertyDescriptor.SetValue() ValueChanged ( , TextBlocks ListBox.
INotifyPropertyChanged, , . , .