/// <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); } }
/// <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); } }