Beispiel #1
0
 public static void SetId(Xaml.DependencyObject target, string id)
 {
     target.SetValue(IdProperty, id);
     if (!string.IsNullOrEmpty(id))
     {
         Delegates[id](target);
     }
 }
Beispiel #2
0
        static void Build(Xaml.DependencyObject target, string id = null, Xaml.UIElement templatedParent = null)
        {
            id ??= GetId(target);
            templatedParent ??= GetTemplatedParent(target);
            if (id is null || templatedParent is null)
            {
                return;
            }

            DependencyObjectExtensions.TemplatedParent = templatedParent;
            try { ConfigureRoot.Delegates[id](target); } // Any template bindings are created here, using the TemplatedParent for source
            finally { DependencyObjectExtensions.TemplatedParent = null; }
        }
        private static void OnPropertyChanged(Microsoft.UI.Xaml.DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            if (!(obj is INotifyObjectOrSubobjectChanged parentObj))
            {
                return;
            }

            // The logic below cascades change notifications from subobjects up the object hierarchy, eventually causing the GraphicsCanvas
            // to be invalidated on any change
            if (e.OldValue is INotifyObjectOrSubobjectChanged oldChildObj)
            {
                oldChildObj.Changed -= parentObj.NotifySinceSubobjectChanged;
            }

            if (e.NewValue is INotifyObjectOrSubobjectChanged newChildObj)
            {
                newChildObj.Changed += parentObj.NotifySinceSubobjectChanged;
            }

            parentObj.NotifySinceObjectChanged();
        }
Beispiel #4
0
 static void OnTemplatedParentChanged(Xaml.DependencyObject target, Xaml.DependencyPropertyChangedEventArgs e) => Build((Xaml.Controls.Panel)target, templatedParent: (Xaml.UIElement)e.NewValue);
Beispiel #5
0
 static void OnIdChanged(Xaml.DependencyObject target, Xaml.DependencyPropertyChangedEventArgs e) => Build((Xaml.Controls.Panel)target, id: (string)e.NewValue);
Beispiel #6
0
 public static void SetTemplatedParent(Xaml.DependencyObject target, Xaml.UIElement parent) => target.SetValue(TemplatedParentProperty, parent);
Beispiel #7
0
 public static Xaml.UIElement GetTemplatedParent(Xaml.DependencyObject target) => (Xaml.UIElement)target.GetValue(TemplatedParentProperty);
Beispiel #8
0
 public static void SetId(Xaml.DependencyObject target, string id) => target.SetValue(IdProperty, id);
Beispiel #9
0
 public static string GetId(Xaml.DependencyObject target) => (string)target.GetValue(IdProperty);
Beispiel #10
0
 public static void Set_AttachedPropertyName_(AttachedPropertyTargetType target, _AttachedPropertyType_ value)
 {
 }