Ejemplo n.º 1
0
            public IEnumerable <CommandEntry> GetCommandEntries(RowSelector rowSelector)
            {
                if (DataPresenter.Scrollable != null)
                {
                    if (DataPresenter.LayoutOrientation.HasValue)
                    {
                        yield return(Commands.MoveUp.Bind(ExecMoveUp, CanExecMoveUp, new KeyGesture(Key.Up)));

                        yield return(Commands.MoveDown.Bind(ExecMoveDown, CanExecMoveDown, new KeyGesture(Key.Down)));

                        yield return(Commands.MoveLeft.Bind(ExecMoveLeft, CanExecMoveLeft, new KeyGesture(Key.Left)));

                        yield return(Commands.MoveRight.Bind(ExecMoveRight, CanExecMoveRight, new KeyGesture(Key.Right)));

                        yield return(Commands.MoveToHome.Bind(ExecMoveToHome, CanExecuteByKeyGesture, new KeyGesture(Key.Home)));

                        yield return(Commands.MoveToEnd.Bind(ExecMoveToEnd, CanExecuteByKeyGesture, new KeyGesture(Key.End)));

                        yield return(Commands.MoveToPageUp.Bind(ExecMoveToPageUp, CanExecuteByKeyGesture, new KeyGesture(Key.PageUp)));

                        yield return(Commands.MoveToPageDown.Bind(ExecMoveToPageDown, CanExecuteByKeyGesture, new KeyGesture(Key.PageDown)));

                        if (Template.SelectionMode == SelectionMode.Extended)
                        {
                            yield return(Commands.SelectExtendedUp.Bind(ExecSelectExtendUp, CanExecMoveUp, new KeyGesture(Key.Up, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedDown.Bind(ExecSelectExtendedDown, CanExecMoveDown, new KeyGesture(Key.Down, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedLeft.Bind(ExecSelectExtendedLeft, CanExecMoveLeft, new KeyGesture(Key.Left, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedRight.Bind(ExecSelectExtendedRight, CanExecMoveRight, new KeyGesture(Key.Right, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedHome.Bind(ExecSelectExtendedHome, CanExecuteByKeyGesture, new KeyGesture(Key.Home, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedEnd.Bind(ExecSelectExtendedEnd, CanExecuteByKeyGesture, new KeyGesture(Key.End, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedPageUp.Bind(ExecSelectExtendedPageUp, CanExecuteByKeyGesture, new KeyGesture(Key.PageUp, ModifierKeys.Shift)));

                            yield return(Commands.SelectExtendedPageDown.Bind(ExecSelectExtendedPageDown, CanExecuteByKeyGesture, new KeyGesture(Key.PageDown, ModifierKeys.Shift)));
                        }
                        if (Template.SelectionMode == SelectionMode.Multiple)
                        {
                            yield return(Commands.ToggleSelection.Bind(ExecToggleSelection, CanExecuteByKeyGesture, new KeyGesture(Key.Space)));
                        }
                    }
                }
            }
Ejemplo n.º 2
0
 private static IEnumerable <CommandEntry> GetCommandEntries(ICommandService commandService, RowSelector rowSelector)
 {
     return(commandService.GetCommandEntries(rowSelector));
 }