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

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

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