複数選択 (SelectedMode = Extended) の WPF データ グリッドがあります。各アイテムには、 https: //stackoverflow.com/a/2615487/284795 ごとに IsSelected バインディングがあります
<DataGrid
ItemsSource="{Binding Items}"
SelectionUnit="FullRow"
SelectionMode="Extended"
SelectedIndex="{Binding SelectedIndex}"
SelectedItem="{Binding SelectedItem}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
</Style>
</DataGrid.RowStyle>
</DataGrid>
私は興味がある。DataGrid の SelectedIndex プロパティと SelectedItem プロパティはどのように動作するようになりましたか? データ グリッドで 2 つの項目が選択されている場合、SelectedItem はどちらを指していますか?
また、これらすべてのバインディングが双方向で、ビュー モデルから 1 つを変更すると、他のバインディングは更新されますか? (おそらくこれが原因で、アプリのバグを観察しています)