ObserverableCollectionで満たされたWPFデータグリッドがあります。
ここで、プログラムの開始時の行の内容と、実行時に何かが変更されたかどうかに応じて、行に色を付けたいと思います。
System.Windows.Controls.DataGrid areaDataGrid = ...;
ObservableCollection<Area> areas;
//adding items to areas collection
areaDataGrid.ItemsSource = areas;
areaDataGrid.Rows <-- Property not available. how to access rows here?
CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(areaDataGrid.Items);
((INotifyCollectionChanged)myCollectionView).CollectionChanged += new NotifyCollectionChangedEventHandler(areaDataGrid_Changed);
...
void areaDataGrid_Changed(object sender, NotifyCollectionChangedEventArgs e)
{
//how to access changed row here?
}
開始時と実行時に行にアクセスするにはどうすればよいですか?