예제 #1
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; }
        }
예제 #2
0
        static void Build(Xaml.Controls.Panel panel, string id = null, Xaml.UIElement templatedParent = null)
        {
            id ??= GetId(panel);
            templatedParent ??= GetTemplatedParent(panel);
            if (id is null || templatedParent is null)
            {
                return;
            }

            panel.Children.Clear();
            DependencyObjectExtensions.TemplatedParent = templatedParent;
            try { panel.Children.Add(BuildChild.Delegates[id]().UI); } // Any template bindings are created here, using the TemplatedParent for source
            finally { DependencyObjectExtensions.TemplatedParent = null; }
        }
예제 #3
0
 public static void SetTemplatedParent(Xaml.Controls.Panel panel, Xaml.UIElement parent) => panel.SetValue(TemplatedParentProperty, parent);
예제 #4
0
 public static void SetTemplatedParent(Xaml.DependencyObject target, Xaml.UIElement parent) => target.SetValue(TemplatedParentProperty, parent);