public BaseUserControl(IBaseModel baseModel, bool applyTheme) { this.applyTheme = applyTheme; DataContext = baseModel; Model = baseModel; BaseWindow.AddStyleResouse(Resources); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); // При изменении темы if (applyTheme) { StyleSettings.Change += (s, a) => { ApplyTheme(); }; BaseWindow.AddStyleResouse(Resources); ApplyTheme(); } }
public static void ApplyWindowTheme(BaseWindow window) { var windowTheme = GetWindowTheme(window); ThemeManager.ChangeTheme(window.Resources, windowTheme.theme); }
internal static (Pik.Metro.Theme theme, bool find) GetWindowTheme(BaseWindow window) { return(GetWindowTheme(GetWindowName(window))); }