private void dataGridOfStoryItems_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var chk = VisualTreeHelpers.FindAncestor <CheckBox>((DependencyObject)e.OriginalSource, "cbStoryItem"); //if (chk == null) //{ // e.Handled = true; //} }
private void cbStoryItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var chk = (CheckBox)sender; var row = VisualTreeHelpers.FindAncestor <DataGridRow>(chk); //var newValue = !chk.IsChecked.GetValueOrDefault(); //row.IsSelected = newValue; //chk.IsChecked = newValue; //// Only if there's something selected is the list verified that the "Create New Tasks" button may be enabled. //settingsViewModel.Settings.IsVerified = settingsViewModel.StoryItems.Where(s => s.IsSelected).Any(); //// Mark event as handled so that the default //// DataGridPreviewMouseDown doesn't handle the event //e.Handled = true; }