Esempio n. 1
0
        private void GridCellMouseDoubleClickHandler(GridCell targetCell, GridCell.GridCellInteractionEventArgs e)
        {
            if (SelectedCell == targetCell && SelectedCell.IsEditable)
            {
                return;
            }
            UnpointCell();

            SelectedCell.UncheckCell();
            SelectedCell            = targetCell;
            SelectedCell.IsEditable = true;

            UpdateBinding();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }