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)); } } }
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); } }
public static Theme?GetTheme(FrameworkElement obj) { ValidationHelper.NotNull(obj, "obj"); return(NullableBoxingHelper <Theme> .Unbox(obj.GetValue(ThemeProperty))); }