Files
BrightSharp.Toolkit/docs/help/apply-themes.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

2017-02-18 00:15:59 +03:00
# Apply themes with App.xaml
`App.xaml`
```xml
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/brightsharp;component/themes/style.classic.xaml" />
<ResourceDictionary Source="/brightsharp;component/themes/theme.xaml" />
2017-02-18 00:15:59 +03:00
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
```
2017-02-18 00:28:19 +03:00
# Change themes by ThemeManager
2017-02-18 00:15:59 +03:00
2017-08-27 13:05:14 +03:00
Change by `ThemeManager`
2017-02-18 00:15:59 +03:00
```c#
ThemeManager.CurrentTheme = ColorThemes.DarkBlue;
2017-02-18 00:15:59 +03:00
```
2017-05-19 20:56:28 +03:00
# Change themes by ResourceDictionary
2017-08-27 13:05:14 +03:00
As default we use Classic theme.
You also can change theme by adding resource dictionary after generic.xaml. Use one of them:
2017-05-19 20:56:28 +03:00
```xml
<ResourceDictionary Source="/brightsharp;component/themes/style.classic.xaml" />
<ResourceDictionary Source="/brightsharp;component/themes/style.devlab.xaml" />
<ResourceDictionary Source="/brightsharp;component/themes/style.silver.xaml" />
<ResourceDictionary Source="/brightsharp;component/themes/style.blue.xaml" />
<ResourceDictionary Source="/brightsharp;component/themes/style.darkblue.xaml" />
2017-05-19 20:56:28 +03:00
```
## NOTES
2017-08-27 13:05:14 +03:00
You can use custom window style named `BrightSharpWindowStyle`.
Also defined additional useful styles and extensions. For more info see Demo source code.
<!--Theme resource use `DynamicResource`. If you want, you can use `StaticResource` via **`theme.static.xaml`**.-->