protected virtual void OnRootCurserPositionChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, Point?> arg) { //if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (sender, v) => { if (arg.Property.NewValue.HasValue) { var newPosition = arg.Property.NewValue.Value; newPosition = this.GetLocation(ActiveControl).Location + (Size)newPosition; Console.SetCursorPosition((int)newPosition.X, (int)newPosition.Y); Console.CursorVisible = true; } else { Console.CursorVisible = false; } }; } }
protected virtual void OnActiveControlChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, FrameworkElement> arg) { if (arg.Provider.HasNewValue && arg.Provider.NewValue != null) { var indexToCheck = this.tabList.IndexOf(arg.Provider.NewValue); if (indexToCheck == -1) { arg.Provider.Reject = true; } } if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (sender, args) => { var newindex = this.tabList.IndexOf(arg.Provider.NewValue); var newValue = args.Property.NewValue; if (newindex == -1 && newValue != null) { throw new ArgumentException("No valid ActiveControl"); } if (args.Property.OldValue != null) { args.Property.OldValue.HasFocus = false; } this.tabSelectedIndex = newindex; if (newValue != null) { newValue.HasFocus = true; foreach (var scrollPane in arg.Property.NewValue.GetPathToRoot().OfType <ScrollPane>()) { scrollPane.BrinIntoView(newValue); } } } } ; }
protected virtual void OnHasFocusChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, bool> arg) { if (!SupportSelection || IsDisabled) { arg.Provider.MutatedValue = false; } if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (oldValue, newValue) => { if (arg.Property.NewValue && RootWindow.ActiveControl != this) { RootWindow.ActiveControl = this; } else if (!arg.Property.NewValue && RootWindow.ActiveControl == this) { RootWindow.ActiveControl = null; } } } ; }
protected virtual void OnCurserPositionChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, Point?> arg) { }
protected virtual void OnTabIndexChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, int> arg) { }