DataViews for WPF ships with several built-in themes that can be easily applied on the different views. The following table contains the URIs of the resource dictionaries of all predefined themes:
Theme | Resource Dictionary URI |
---|---|
Mild | Themes/Mild.xaml |
Vista | Themes/Vista.xaml |
WindowsBlue | Themes/WindowsBlue.xaml |
To apply a specific theme, simply add it to a resource dictionary in your application's visual tree by using a MergedDictionaries. The following example demonstrates how to add the Vista theme in XAML:
XAML Copy Code |
---|
<Grid> |
Themes can also be dynamically applied or removed through code by following the same pattern. The code below illustrates this:
C# Copy Code |
---|
var res = new ResourceDictionary(); |
Visual Basic Copy Code |
---|
Dim res = New ResourceDictionary() |
The images below illustrate an ActivityChart with different themes applied to it: