Пример #1
0
 public BaseUserControl(IBaseModel baseModel, bool applyTheme)
 {
     this.applyTheme = applyTheme;
     DataContext = baseModel;
     Model = baseModel;
     BaseWindow.AddStyleResouse(Resources);
 }
Пример #2
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            // При изменении темы
            if (applyTheme)
            {
                StyleSettings.Change += (s, a) => { ApplyTheme(); };
                BaseWindow.AddStyleResouse(Resources);
                ApplyTheme();
            }
        }
Пример #3
0
        public static void ApplyWindowTheme(BaseWindow window)
        {
            var windowTheme = GetWindowTheme(window);

            ThemeManager.ChangeTheme(window.Resources, windowTheme.theme);
        }
Пример #4
0
 internal static (Pik.Metro.Theme theme, bool find) GetWindowTheme(BaseWindow window)
 {
     return(GetWindowTheme(GetWindowName(window)));
 }