private void GridCellMouseClickHandler(GridCell targetCell, GridCell.GridCellInteractionEventArgs e) { if (SelectedCell == targetCell) { return; } UnpointCell(); if (SelectedCell.IsEditable) { if (PointingIsAllowed()) { PointToCell(targetCell); return; } else { SelectedCell.IsEditable = false; SelectedCell = targetCell; SelectedCell.IsSelected = true; } } else { SelectedCell.IsSelected = false; SelectedCell = targetCell; SelectedCell.IsSelected = true; } UpdateBinding(); }
private void GridCellInteractionHandler(Object sender, GridCell.GridCellInteractionEventArgs e) { var targetCell = sender as GridCell; if (targetCell == null) { return; } if (e.eventType == GridCell.GridCellInteractionEventArgs.CellEvent.MouseClick) { if (e.clickNumber == 1) { GridCellMouseClickHandler(targetCell, e); } else if (e.clickNumber == 2) { GridCellMouseDoubleClickHandler(targetCell, e); } } else if (e.eventType == GridCell.GridCellInteractionEventArgs.CellEvent.EditFinished) { GridCellEditFinishedHandler(targetCell, e); } }
private void GridCellMouseDoubleClickHandler(GridCell targetCell, GridCell.GridCellInteractionEventArgs e) { if (SelectedCell == targetCell && SelectedCell.IsEditable) { return; } UnpointCell(); SelectedCell.UncheckCell(); SelectedCell = targetCell; SelectedCell.IsEditable = true; UpdateBinding(); }
private void GridCellEditFinishedHandler(GridCell gridCell, GridCell.GridCellInteractionEventArgs e) { if (gridCell == null) { return; } if (gridCell != SelectedCell) { return; } if (!gridCell.IsEditable) { return; } UnpointCell(); gridCell.IsEditable = false; gridCell.IsSelected = true; UpdateBinding(); TryMoveSelection(Direction.Bottom); }