Exemplo n.º 1
0
        private static void OnThemeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            var control = obj as FrameworkElement;

            if (control != null)
            {
                if (DesignerProperties.GetIsInDesignMode(control))
                {
                    Manager.SetTheme(control, NullableBoxingHelper <Theme> .Unbox(e.NewValue));
                }
            }
        }
Exemplo n.º 2
0
        private static void OnThemeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            var control = obj as FrameworkElement;

            if (control != null)
            {
                var theme = NullableBoxingHelper <Theme> .Unbox(e.NewValue);

                control.Apply(theme, GetAccentBrush(control), GetContrastBrush(control));
                TryRemove(control);
            }
        }
Exemplo n.º 3
0
 public static Theme?GetTheme(FrameworkElement obj)
 {
     ValidationHelper.NotNull(obj, "obj");
     return(NullableBoxingHelper <Theme> .Unbox(obj.GetValue(ThemeProperty)));
 }