protected virtual void OnCheckedCharacterChanging(OnChangingArg <NDPConfiguration, char> arg) { if (arg.Property.IsObjectValueChanging) { InvalidateRender(); } }
protected virtual void OnIsThreeStateChanging(OnChangingArg <NDPConfiguration, bool> arg) { if (arg.Property.IsObjectValueChanging) { InvalidateRender(); } }
protected virtual void OnRootWindowChanging(OnChangingArg <NDPConfiguration, RootWindow> arg) { if (this is RootWindow && arg.Provider.NewValue == null) { arg.Provider.MutatedValue = this as RootWindow; } }
protected virtual void OnPaddingChanging(OnChangingArg <NDPConfiguration, Thickness> arg) { arg.ExecuteAfterChange += (oldValue, newValue) => { if (oldValue != newValue) { InvalidateMeasure(); } }; }
protected virtual void OnSecondaryColorDisabledChanging(OnChangingArg <NDPConfiguration, ConsoleColor> arg) { arg.ExecuteAfterChange += (oldValue, newValue) => { if (oldValue != newValue) { InvalidateRender(); } }; }
protected virtual void OnIsCheckedChanging(OnChangingArg <NDPConfiguration, bool?> arg) { if (arg.Provider.HasNewValue && !arg.Provider.NewValue.HasValue && !IsThreeState) { arg.Provider.Reject = true; } else if (arg.Property.IsObjectValueChanging) { InvalidateRender(); } }
private void OnStrChanged(OnChangingArg <Configuration, string> arg) { if (Reject) { arg.Provider.Reject = Reject; } if (Mutate != null) { arg.Provider.MutatedValue = Mutate; } }
protected void OnContentChanging(OnChangingArg <NDPConfiguration, object> arg) { if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (sender, e) => { DisplayContent = Template.InstanciateFromDefaultDataTemplate(e.Property.NewValue); } } ; }
protected virtual void OnCloseParenthiseChanging(OnChangingArg <NDPConfiguration, char?> arg) { if (arg.Property.IsObjectValueChanging) { if (arg.Property.NewValue == null || arg.Property.OldValue == null) { InvalidateMeasure(); } else { InvalidateRender(); } } }
protected void OnDisplayContentChanging(OnChangingArg <NDPConfiguration, UIElement> arg) { if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (sender, e) => { if (e.Property.OldValue != null) { e.Property.OldValue.VisualParent = null; } if (e.Property.NewValue != null) { e.Property.NewValue.VisualParent = this; } InvalidateMeasure(); } } ; }
protected override void OnRootWindowChanging(OnChangingArg <NDPConfiguration, RootWindow> arg) { if (arg.Property.IsObjectValueChanging) { arg.ExecuteAfterChange += (sender, args) => { if (SupportSelection && !IsDisabled) { if ((args.Property.OldValue?.ActiveControl ?? null) == this) { args.Property.OldValue.ActiveControl = null; } args.Property.OldValue?.tabList.Remove(this); args.Property.NewValue?.tabList.Add(this); } base.OnRootWindowChanging(arg); } } ; }
private static void OnColumnSpanChanging(OnChangingArg <NDPConfiguration, UIElement, int> arg) { }
protected virtual void OnMinWidthChanging(OnChangingArg <NDPConfiguration, IntEx> arg) { }
protected virtual void OnNameChanging(OnChangingArg <NDPConfiguration, string> arg) { }
private void OnNotifyTestChanging(OnChangingArg <Configuration, string> arg) { }
private static void OnAttachChanged(OnChangingArg <Configuration, string, object> arg) { }
protected virtual void OnActualWidthChanging(OnChangingArg <NDPConfiguration, int> arg) { }
protected virtual void OnTagChanging(OnChangingArg <NDPConfiguration, object> arg) { }
private void OnMyBlaChanging(OnChangingArg <Configuration, string> arg) { var test = TestAttributeProperty.ToString(); }
protected virtual void OnHorizontalAlignmentChanging(OnChangingArg <NDPConfiguration, HorizontalAlignment> arg) { InvalidateArrange(); }
//protected bool Update<TType, TValue>(object sender, TType targetObject, NDBasePropertyKey<TKey, TType, TValue> property, TValue newValue, bool hasNewValue, TValue oldValue, bool hasOldValue, ValueProvider<TKey> currentProvider, TValue currentValue) // where TType : class //{ // return Update(sender, targetObject, property, newValue, hasNewValue, () => true, oldValue, hasOldValue, currentProvider, currentValue); //} internal bool Update <TType, TValue>(object sender, TType targetObject, NDBasePropertyKey <TKey, TType, TValue> property, TValue newProviderValue, bool hasNewValue, Func <TValue, bool> updateCode, TValue oldProviderValue, bool hasOldValue, ValueProvider <TKey> oldActualProvider, TValue oldActualValue) where TType : class { var otherProviderIndex = PropertyRegistar <TKey> .ProviderOrder[oldActualProvider]; var thisIndex = PropertyRegistar <TKey> .ProviderOrder[this]; if (!property.Settigns.HasFlag(NDPropertySettings.CallOnChangedHandlerOnEquals) && Object.Equals(oldProviderValue, newProviderValue) && hasOldValue == hasNewValue) { return(true); } TValue newActualValue = default; ValueProvider <TKey> newActualProvider = null; if (this == oldActualProvider && !hasNewValue) { // the current value was provided by the changing provider but now it will no longer have a value // we need to find out what the new value will be. bool found = false; foreach (var item in PropertyRegistar <TKey> .ValueProviders) { if (item == this) { continue; } var(providerValue, hasValue) = item.GetValue(targetObject, property); if (hasValue) { found = true; newActualProvider = item; newActualValue = providerValue; break; } } if (!found) { throw new InvalidOperationException("No Value Found"); } } else if (otherProviderIndex >= thisIndex) { newActualProvider = this; newActualValue = newProviderValue; } else { newActualProvider = oldActualProvider; newActualValue = oldActualValue; } // We need to call the actial update after we recived the current old value. Otherwise we could already read the OnChangingArg <TKey, TValue> onChangingArg; if (property as object is NDAttachedPropertyKey <TKey, TType, TValue> attach) { var attachArg = OnChangingArg.Create(targetObject, oldProviderValue, hasOldValue, newProviderValue, hasNewValue, this, oldActualProvider, newActualProvider, oldActualValue, newActualValue, hasNewValue || !this.canDeletionBePrevented); onChangingArg = attachArg; attach.changedMethod(attachArg); } else if (property as object is NDPropertyKey <TKey, TType, TValue> p) { onChangingArg = OnChangingArg.Create(oldProviderValue, hasOldValue, newProviderValue, hasNewValue, this, oldActualProvider, newActualProvider, oldActualValue, newActualValue, hasNewValue || !this.canDeletionBePrevented); p.changedMethod(targetObject)(onChangingArg); } else { throw new NotSupportedException(); } var result = PropertyRegistar <TKey> .ChangeValue(sender, property, targetObject, onChangingArg, updateCode); FireEventHandler(property, targetObject, sender, ChangedEventArgs.Create(targetObject, property, oldProviderValue, newProviderValue)); return(result); }
protected virtual void OnMarginChanging(OnChangingArg <NDPConfiguration, Thickness> arg) { InvalidateMeasure(); }
protected virtual void OnIsPressedChanging(OnChangingArg <NDPConfiguration, bool> arg) { }
protected virtual void OnMaxHeightChanging(OnChangingArg <NDPConfiguration, IntEx> arg) { }
//[System.ComponentModel.DefaultValue("asdf")] private void OnTestAttributeChanging(OnChangingArg <Configuration, MyStruct> arg) { var test = TestAttributeProperty.ToString(); }