private void HandleValueChange(object sender, NMF.Expressions.ValueChangedEventArgs eventArgs) { System.Collections.Specialized.NotifyCollectionChangedEventArgs collectionEvent = null; if ((eventArgs.NewValue != null)) { if ((eventArgs.OldValue != null)) { collectionEvent = new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Replace, eventArgs.NewValue, eventArgs.OldValue); } else { collectionEvent = new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Add, eventArgs.NewValue); } } else { collectionEvent = new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Remove, eventArgs.OldValue); } this.OnCollectionChanged(collectionEvent); }
private void Element_ParentChanged(object sender, ValueChangedEventArgs e) { if (Child != null) { Child.Detach(); } RenewChild(); }
protected virtual void OnValueChanged(ValueChangedEventArgs e) { ValueChanged?.Invoke(this, e); }