❔ Property Changed

EElio12/20/2022
Hello there, i'm currently developing an app in wpf using the model mvvm and i do not understand why my datagrid won't refresh when i call : OnPropertyChanged(nameof(Thicknesses))
to specify, i've set my datagrid to
ItemsSource="{Binding Thicknesses, UpdateSourceTrigger=PropertyChanged}"
and the List Thicknesses is supposed to be refreshed by 2 things :
- the first one is when i change the Material which each one contains a list of thicknesses
- the second on is when i add a new thickness
OnPropertyChanged(nameof(Thicknesses)) is well triggered when one of the 2 case i mentioned is filled but the update seem to works only if change the Material but not when i add a new thickness to it.
Image
AAlexicon12/20/2022
You probably need to change the "IEnumerable<Thickness>" in your view model to an "ObservableCollection<Thickness>" instead if you want it to capture add and remove events.
EElio12/21/2022
thanks it work :heartowo:
AAccord12/22/2022
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.