예제 #1
0
        /// <summary>
        /// Starts the navigator on the Design surface and add bindings.
        /// </summary>
        public void Start()
        {
            var tabFocus      = new RelayCommand(this.MoveFocusForward, this.CanMoveFocusForward);
            var shiftTabFocus = new RelayCommand(this.MoveFocusBack, this.CanMoveFocusBack);

            _tabBinding      = new KeyBinding(tabFocus, new KeyGesture(Key.Tab));
            _shiftTabBinding = new KeyBinding(shiftTabFocus, new KeyGesture(Key.Tab, ModifierKeys.Shift));
            IKeyBindingService kbs = _surface.DesignContext.Services.GetService(typeof(IKeyBindingService)) as IKeyBindingService;

            if (kbs != null)
            {
                kbs.RegisterBinding(_tabBinding);
                kbs.RegisterBinding(_shiftTabBinding);
            }
        }
예제 #2
0
        /// <summary>
        /// Starts the navigator on the Design surface and add bindings.
        /// </summary>
        public void Start()
        {
            DesignCommand tabFocus      = new DesignCommand(parameter => this.MoveFocusForward(_surface), parameter => CanMoveFocusForward(_surface));
            DesignCommand shiftTabFocus = new DesignCommand(parameter => this.MoveFocusBack(_surface), parameter => this.CanMoveFocusBack(_surface));

            _tabBinding      = new KeyBinding(tabFocus, new KeyGesture(Key.Tab));
            _shiftTabBinding = new KeyBinding(shiftTabFocus, new KeyGesture(Key.Tab, ModifierKeys.Shift));
            IKeyBindingService kbs = _surface.DesignContext.Services.GetService(typeof(IKeyBindingService)) as IKeyBindingService;

            if (kbs != null)
            {
                kbs.RegisterBinding(_tabBinding);
                kbs.RegisterBinding(_shiftTabBinding);
            }
        }