ObserverableCollection으로 채워진 WPF DataGrid가 있습니다.WPF Datagrid 행 색상 변경
이제 프로그램 시작시 및 런타임 중에 변경된 행 내용에 따라 행의 색을 지정하려고합니다.
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?
}
어떻게 시작 및 런타임에 행에 액세스합니까?