1
我有一個DataGrid綁定到一個靜態的ListCollectionViewDatagrid的數據綁定
CompassLogView類:
public static ListCollectionView Compasscollection {
get {
if (_compasscollection == null) {
_compasscollection =
new ListCollectionView(LogSession.CompassLogCollection);
}
return _compasscollection;
}
set { _compasscollection = value; }
}
綁定
compassLogDataGrid.DataContext = CompassLogView.Compasscollection;
DataGrid中的XAML:
<DataGrid x:Name="compassLogDataGrid"
ItemsSource="{Binding}"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True"
SelectedItem="{Binding Path=Synchronizer.CurrentCompassLogDataItem}"
Style="{DynamicResource ResourceKey=dataGridStyle}">
...
</DataGrid>
的SelectedItem
(LINE 5)必須綁定到Synchronizer
類別的currentCompassLogDataItem
。
我已經嘗試過,但似乎不可能。有什麼建議麼?