更新时间:2023-12-03 13:41:46
仅当选择实际上更改为预期的行为时,才引发 SelectionChanged
事件。
The SelectionChanged
event is only supposed to be raised when the selection actually changes to this is the expected behaviour.
您可以尝试处理 DataGridRow
的 PreviewMouseLeftButtonDown
容器:
You could try to handle the PreviewMouseLeftButtonDown
of the DataGridRow
containers:
<DataGrid ...>
<DataGrid.ItemContainerStyle>
<Style TargetType="DataGridRow">
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="dg_MouseLeftButtonDown"></EventSetter>
</Style>
</DataGrid.ItemContainerStyle>
...
</DataGrid>