我有一个绑定到静态 ListCollectionView 的数据网格
CompassLogView 类:
public static ListCollectionView Compasscollection {
get {
if (_compasscollection == null) {
_compasscollection =
new ListCollectionView(LogSession.CompassLogCollection);
}
return _compasscollection;
}
set { _compasscollection = value; }
}
绑定
compassLogDataGrid.DataContext = CompassLogView.Compasscollection;
数据网格 Xaml:
<DataGrid x:Name="compassLogDataGrid"
ItemsSource="{Binding}"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True"
SelectedItem="{Binding Path=Synchronizer.CurrentCompassLogDataItem}"
Style="{DynamicResource ResourceKey=dataGridStyle}">
...
</DataGrid>
( SelectedItem
LINE 5) 必须绑定到currentCompassLogDataItem
哪个是Synchronizer
类。
我试过了,但似乎不可能。有什么建议么?