Пример #1
0
        public static IFluentStyle PanelTemplate(this IFluentStyle fluentStyle, IFluentTemplateItem template)
        {
            var fluentTemplateItem          = template as FluentTemplateItem;
            FrameworkElementFactory factory = fluentTemplateItem.GetFactory();

            factory.SetValue(Panel.IsItemsHostProperty, true);
            fluentStyle.Set(ItemsControl.ItemsPanelProperty, new ItemsPanelTemplate {
                VisualTree = factory
            });

            return(fluentStyle);
        }
Пример #2
0
        public static IFluentStyle Template(this IFluentStyle fluentStyle, ControlTemplate template)
        {
            fluentStyle.Set(Control.TemplateProperty, template);

            return(fluentStyle);
        }