Retain DataGrid IsSelectionActive when a ContextMenu opens in WPF?
问题 I have a DataGrid which has a style for IsSelectionActive ; however, as soon as the ContextMenu opens, the grid loses IsSelectionActive and it looks like to the user that as if the context menu somehow took the selection and may confuse the user. Is there a way to retain IsSelectionActive when a context menu opens? <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <!--<Condition Property="Selector.IsFocused" Value="True" />--> <Condition Property="IsSelected" Value="True" />