I have a Datagrid. I want to refresh it when a event occurs.
So I have this :
<DataGrid Name="matrix"
Background="#3f4953"
dataGrid2D:ItemsSource.Array2D="{Binding Path= Matrix,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged
}"/>
I made this property in my ViewModel :
public string[,] Matrix { get; set; }
I made some maths to populate a 2d Array and I have this :
Matrix = resultOfMyMaths;
I have this in my Xaml too :
<UserControl.DataContext>
<Binding Source="{StaticResource vm}" />
</UserControl.DataContext>
How can i Refresh my Datagrid now ?
For information : I change the value of Matrix in my code, it works. But my gridView doesn't refreh. I just have to bind the new value of Matrix in my datagrid.
I can't use an observableCollection because it's a multidimentional Array. And I can't cast my array to ObservableCollection. I already tried.