ModernUI Tutorial: create a custom topic, modernui custom
Modern ui wpf includes two built-in themes (dark and light ). In version 1.0.3, you can build custom themes. Modern UI applications are usually defined in the global resource dictionary App. xaml as follows:
The "/FirstFloor. ModernUI; component/Assets/ModernUI. xaml" dictionary contains the Modern UI style of the core WPF controls (such as Button buttons, TextBlock, and ListBox boxes. The second dictionary contains the definition of the paint brush and other resources. If you want to use a custom topic, you need to replace the second dictionary with your own version.
Create a new topic:
The following steps describe how to create a new topic.
1) Make sure that you have installed the latest Modern UI for WPF template extension for Visual Studio 2012.
2) create a new or open an existing Modern UI Project
3) add an Assets file to your project
4) add a new item to the Assets folder. In the Add new project dialog box, navigate to Visual c # project> Modern UI for WPF and select the Modern UI topic. Rename the file to ModernUI. MyTheme and select Add dd.
5) open App. xaml and replace the current topic with a new topic;
6) Compile and run the project. Your application will display a new theme like this;
Custom topic:
A custom topic is generally a theme derived from a dark or light. A topic derived from a built-in topic automatically contains all required resources. So what you need to do is to overwrite these resources, or you can choose not to overwrite the built-in theme resources, but you need to provide new theme resources.
It is easy to derive a built-in topic. Refer to the dark or light topic to add a MergedDictionary reference;
By adding the following brush resource to your custom topic, all buttons will become red backgrounds:
By adding the following brush resource to your custom topic, all buttons will become red backgrounds:
See a complete overview of all resources required by a topic in topic resource reference.
Portal: ModernUI Tutorial: Directory