It depends on your intentions regarding the subject; as Hans says in his comment, usually using the system "theme" for controls and the appearance of the window is considered active.
However, for theme elements in your application - for example, the title bar background or title font color, etc., then I would build an interface with color / image definitions in your application (e.g. ITheme ) and then just use regular data binding for proper configuration at runtime when ITheme .
public interface ITheme { string Name { get; } Image Logo { get; } String BrandText1 { get; } String BrandText2 { get; } Image BrandBannerLogo { get; } Color BrandPanelText_Left { get; } Color BrandPanelText_Centre { get; } }
In fact, you can take another step ... For example, in our application, we also define IThemeManager :
public interface IThemeManager : INotifyPropertyChanged { event EventHandler CurrentThemeChanged; ITheme CurrentTheme { get; set; } Dictionary<string, ITheme> AvailableThemes { get; } }
We allow the ThemeManager attachment to get involved, and then bind the Current property to it in our controls:
[Dependency] public IThemeManager ThemeManager { get { return _themeManager; } set { if (_themeManager != value) { _themeManager = value; if (_themeManager != null && !DesignMode) { _headerPanelBackgroundImageBinding = themePanel.DataBindings.Add("BackgroundImage", ThemeManager, "CuurentTheme.Logo", false, DataSourceUpdateMode.Never); } else {
source share