I’m using DataGrid bound to List property in my user control:
<DataGrid x:Name="dataGrid" ....
ItemsSource="{Binding ItemSorce, ElementName=UserControl}"
....>
My problem is that I need it updated every time I change the source.
I had the user control implement INotifyPropertyChanged and do raise PropertyChanged event, but the DataGrid original content remains the same.
I’ve read that for the DataGrid to change, I should set BindingSource between ItemSorce and the binding, but all examples I’ve seen are doing this via c# source code.
How do I set BindingSource via xaml, and is this the best way to synchronize the DataGrid and ItemSorce?
Use a
ObservableCollection<>instead of aList<>as it is designed for bindings.