Esempio n. 1
0
 public BaseUserControl(IBaseModel baseModel, bool applyTheme)
 {
     this.applyTheme = applyTheme;
     DataContext = baseModel;
     Model = baseModel;
     BaseWindow.AddStyleResouse(Resources);
 }
Esempio n. 2
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

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

            ThemeManager.ChangeTheme(window.Resources, windowTheme.theme);
        }
Esempio n. 4
0
 internal static (Pik.Metro.Theme theme, bool find) GetWindowTheme(BaseWindow window)
 {
     return(GetWindowTheme(GetWindowName(window)));
 }