I do it this way in code behind:
private void DataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
DataGridCell obj = (DataGridCell)Keyboard.FocusedElement;
if (obj == null) { return; }
if (obj.Content == null) { return; }
if (obj.Content.GetType() == typeof(CheckBox))
{
CheckBox cb = (CheckBox)obj.Content;
Point x = Mouse.GetPosition(cb);
if (x.X < cb.ActualWidth && x.Y < cb.ActualHeight)
{
cb.IsChecked = (bool)cb.IsChecked ? false : true;
}
}
}