Beispiel #1
0
        protected virtual void OnContentChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, object> arg)
        {
            if (arg.Property.IsObjectValueChanging)
            {
                arg.ExecuteAfterChange += (sender, args) =>
                {
                    if (arg.Property.OldValue is UIElement oldValue)
                    {
                        if (oldValue != null)
                        {
                            oldValue.LogicalParent = null;
                        }
                    }

                    if (arg.Property.NewValue is UIElement newValue)
                    {
                        if (newValue.LogicalParent != null)
                        {
                            throw new ArgumentException($"The Element is already Chiled of {newValue.VisualParent}");
                        }

                        if (newValue != null)
                        {
                            newValue.LogicalParent = this;
                        }
                    }
                    UpdateContentPresenter();
                }
            }
            ;
        }
Beispiel #2
0
 protected virtual void OnContentPresenterChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, ContentPresenter> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, args) => UpdateContentPresenter();
     }
 }
Beispiel #3
0
 protected virtual void OnValueChanging(NDProperty.Propertys.OnChangingArg <Propertys.NDPConfiguration, int> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, e) => UpdateBlockPosition();
     }
 }
Beispiel #4
0
 protected virtual void OnOrientationChanging(NDProperty.Propertys.OnChangingArg <Propertys.NDPConfiguration, Orientation> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, e) => InvalidateMeasure();
     }
 }
Beispiel #5
0
 protected void OnFirstNameChanging(NDProperty.Propertys.OnChangingArg <NSCI.Propertys.NDPConfiguration, string> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         Name = $"{arg.Property.NewValue} {SureName}";
     }
 }
Beispiel #6
0
 private void OnCurrentSelectedIndexChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, int> arg)
 {
     if (arg.Provider.NewValue >= this.persons.Count || (arg.Provider.NewValue < 0 && this.persons.Count != 0))
     {
         arg.Provider.Reject = true;
     }
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, e) =>
                                   Update();
     }
 }
Beispiel #7
0
 private void OnPanelChanging(NDProperty.Propertys.OnChangingArg <Propertys.NDPConfiguration, Panel> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         if (arg.Property.OldValue != null)
         {
             arg.Property.OldValue.VisualParent = null;
         }
         if (arg.Property.NewValue != null)
         {
             arg.Property.NewValue.VisualParent = this;
         }
     }
 }
Beispiel #8
0
 protected virtual void OnBorderStyleChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, BorderStyle> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, args) =>
         {
             var oldThickness = CalculateBorderThikness(args.Property.OldValue);
             var newThickness = CalculateBorderThikness(args.Property.NewValue);
             if (oldThickness != newThickness)
             {
                 InvalidateMeasure();
             }
             // InvalidateMeasure not always results in invalidate Render!
             InvalidateRender();
         }
     }
     ;
 }
Beispiel #9
0
 protected virtual void OnChildChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, UIElement> arg)
 {
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, e) =>
         {
             if (e.Property.OldValue?.VisualParent == this)
             {
                 e.Property.OldValue.LogicalParent = null;
                 e.Property.OldValue.VisualParent  = null;
             }
             if (e.Property.NewValue != null)
             {
                 e.Property.NewValue.VisualParent  = this;
                 e.Property.NewValue.LogicalParent = this;
             }
             InvalidateMeasure();
         }
     }
     ;
 }
Beispiel #10
0
 protected virtual void OnTextChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, string> arg)
 {
     if (arg.Provider.CanMutate)
     {
         arg.Provider.MutatedValue = arg.Provider.NewValue?.Replace("\t", "    ").Replace("\r", "");
     }
     if (arg.Property.IsObjectValueChanging)
     {
         arg.ExecuteAfterChange += (sender, e) =>
         {
             var(_, oldWidht, oldHeight) = GetTextDimensions(e.Property.OldValue);
             var(_, newWidht, newHeight) = GetTextDimensions(e.Property.NewValue);
             if (oldHeight != newHeight || oldWidht != newWidht)
             {
                 InvalidateMeasure();
             }
             else
             {
                 InvalidateArrange();
             }
         }
     }
     ;
 }
Beispiel #11
0
 private static void OnResourcesChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, object, Resources> arg)
 {
 }
Beispiel #12
0
 private static void OnKeyChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, object, string> arg)
 {
 }
Beispiel #13
0
 private static void OnTargetTypeChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, object, Type> arg)
 {
 }
Beispiel #14
0
 private void OnCountChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, int> arg)
 {
 }
Beispiel #15
0
 private void OnHasPreviousChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, bool> arg)
 {
 }
Beispiel #16
0
 private void OnCurrentChanging(NDProperty.Propertys.OnChangingArg <NDPConfiguration, Person> arg)
 {
 }
Beispiel #17
0
 protected void OnStreetChanging(NDProperty.Propertys.OnChangingArg <NSCI.Propertys.NDPConfiguration, string> arg)
 {
 }