MindFusion.Wpf Pack Programmer's Guide
Themes

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>
  <Grid.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/MindFusion.DataViews.Wpf;component/Themes/Vista.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Grid.Resources>

  <!-- Add the respective view here. -->

</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();

res.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(@"/MindFusion.DataViews.Wpf;component/Themes/Vista.xaml", UriKind.RelativeOrAbsolute) });

grid.Resources = res;

Visual Basic  Copy Code

Dim res = New ResourceDictionary()

res.MergedDictionaries.Add(New ResourceDictionary() With {.Source = New Uri("/MindFusion.DataViews.Wpf;component/Themes/Vista.xaml", UriKind.RelativeOrAbsolute)})

grid.Resources = res

The images below illustrate an ActivityChart with different themes applied to it:

Generic

Mild

Vista

WindowsBlue