Checking the checkbox previewmouseup event should not fire

Feb 2 2019 9:50 AM
clicking anywhere on the dataGrid row, the checkbox need to be checked & corresponding checkbox trigger action is performed. If am clicking on anywhere on the dataGrid row, checkbox is checking but i have placed the Checkbox in 1st column problem is when i try to check the checkbox then two events are calling checkbox checked/unchecked and mouseup event is also firing. In this scenario the Mouseup should not get fired.
 
<DataGrid>
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseUp">
<i:InvokeCommandAction Command="{Binding DataContext.RowSelectionCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding DataContext.CheckedCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</i:EventTrigger>
<i:EventTrigger EventName="Unchecked">
<i:InvokeCommandAction Command="{Binding DataContext.UnCheckedCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</i:EventTrigger>
</CheckBox>
</DataTemplate>
<DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>

Answers (1)