public void WidgetShouldApplyDefault()
        {
            var style = new DefaultStyleProvider();

            style.Add <StyledWidget>(null, h => h.SomeProperty = true);

            var oldProvider = Style.Provider;

            Style.Provider = style;
            try
            {
                var styledWidget = new StyledWidget();
                Assert.IsTrue(styledWidget.SomeProperty);
            }
            finally
            {
                Style.Provider = oldProvider;
            }
        }
        public void HandlerWithStyleShouldApply()
        {
            var style = new DefaultStyleProvider();

            style.Add <StyledWidgetHandler>("style", h => h.SomeProperty = true);

            var oldProvider = Style.Provider;

            Style.Provider = style;
            try
            {
                var styledWidget = new StyledWidget();
                Assert.IsFalse(styledWidget.SomeProperty);
                styledWidget.Style = "style";
                Assert.IsTrue(styledWidget.SomeProperty);
            }
            finally
            {
                Style.Provider = oldProvider;
            }
        }