C
Join ServerC#
help
❔ 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 :
to specify, i've set my datagrid to
and the List
- the first one is when i change the
- the second on is when i add a new thickness
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.
EElio12/20/2022
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 

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.