Esempio n. 1
0
        /// <summary>
        /// Sets the TemplatedParent property for the created template children.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="templatedParent">The templated parent to apply.</param>
        internal static void ApplyTemplatedParent(IStyledElement control, ITemplatedControl?templatedParent)
        {
            control.SetValue(TemplatedParentProperty, templatedParent);

            var children = control.LogicalChildren;
            var count    = children.Count;

            for (var i = 0; i < count; i++)
            {
                if (children[i] is IStyledElement child && child.TemplatedParent is null)
                {
                    ApplyTemplatedParent(child, templatedParent);
                }
            }
        }
 public static void SetClasses(IStyledElement element, Classes value)
 {
     element.SetValue(ClassesProperty, value);
     OnClassesChanged(element, value);
 }
Esempio n. 3
0
 /// <summary>
 /// Style
 /// </summary>
 /// <param name="element"></param>
 /// <param name="value"></param>
 public static void SetStyle(IStyledElement element, IStyle value)
 {
     element.SetValue(StyleProperty, value);
     OnStyleChanged(element, value);
 }