private void GridCellMouseDoubleClickHandler(GridCell targetCell, GridCell.GridCellInteractionEventArgs e) { if (SelectedCell == targetCell && SelectedCell.IsEditable) { return; } UnpointCell(); SelectedCell.UncheckCell(); SelectedCell = targetCell; SelectedCell.IsEditable = true; UpdateBinding(); }
public bool TrySelect(GridCoordinates targetCell) { if (!watchedCells.ContainsKey(targetCell)) { return(false); } if (targetCell.Equals(SelectedCell.CellPosition)) { return(false); } UnpointCell(); SelectedCell.UncheckCell(); SelectedCell = watchedCells[targetCell]; SelectedCell.IsSelected = true; UpdateBinding(); return(true); }
public bool TryMoveSelection(Direction dir) { if (SelectedCell == null) { return(false); } if (!CoordsInDirectionExist(dir, out GridCoordinates targetCoordinates)) { return(false); } SelectedCell.UncheckCell(); SelectedCell = watchedCells[targetCoordinates]; SelectedCell.IsSelected = true; UnpointCell(); UpdateBinding(); return(true); }