Update itemssource in PersistChanges when working with a primitive collection editor#1803
Update itemssource in PersistChanges when working with a primitive collection editor#1803ykarpeev wants to merge 1 commit intoxceedsoftware:masterfrom
Conversation
…itemssource - allows to see the change in view model
|
Hello, I wrote a sample to test your situation. Please correct it if not accurate.
`public partial class MainWindow : Window } private void Button_Click( object sender, RoutedEventArgs e ) public class MyObject public string Name { get; set; } public List ListOfStrings } Steps: so the MyObjects is correctly updated. |
|
For me I was using MVVM and here is what I have: When changing the collection in the propertygrid the Set method on Test is never called - but it does work with these changes. |
|
The setter of MainViewModel.Test won't be called because this collection is always the same. Only its content is modified through the PropertyGrid Collection Editor. |
|
Thanks. In this case for me the propertygrid is bound to a configuration class & when the Set is called on a property I save the settings to a file & so having an indification that the collection changed works really well. That's why I made this change - I couldn't find a way to get that notification any other way. |
If I have a viewmodel that I bind to the propertygrid that has a property such as:
When editing the collection I do not see the "set" called when the changes are made. This change allows for it to happen.