ObserverableCollectionで埋められたWPFデータグリッドがあります。WPF Datagrid Row Colorを変更します。
ここでは、プログラムの開始時および実行時に何かが変化した場合に、行の内容に応じて行を色付けしたいと考えています。
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?
}
開始時と実行時にどのように行にアクセスできますか?