Version

Referencing a ThemePack in XAML

Since styling is such an important task in application development, the Ultimate UI for WPF controls all include built-in themes you can use for styling. In addition, Ultimate UI for WPF controls also have separate ThemePacks that are included in the installer. ThemePacks are simply compiled assemblies; which removes the complication of referencing one in your project.

Follow these steps to reference a ThemePack in your project.

  1. For easier access to the ThemePack, add the following namespace declaration inside the opening Page or Window tag.

In XAML:

xmlns:igThemesLipStick="http://infragistics.com/Themes/Lipstick"
  1. Create a Resources section for the Page or Window and add a ResourceDictionary. The following XAML adds a ResourceDictionary to the Resources section of a Page.

In XAML:

<Page.Resources>
        <ResourceDictionary>
      ...
        </ResourceDictionary>
</Page.Resources>
  1. Inside the ResourceDictionary, define a MergedDictionaries section.

In XAML:

<Page.Resources>
        <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                ...
                </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
</Page.Resources>
  1. The follow XAML adds style references for all the Ultimate UI for WPF controls. This would cause every Ultimate UI for WPF control on the Page to use the Lipstick ThemePack.

In XAML:

<Page.Resources>
        <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                        <!--Styles all controls using the LipStick ThemePack-->
                        <igThemesLipStick:DataPresenter />
                        <igThemesLipStick:Primitives  />
                        <igThemesLipStick:Editors  />
                </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
</Page.Resources>
  1. Once added to a Page with xamDataGrid™, you will see a pink theme similar to the screen shot below.

xamdatagrid referencing a themepack in XAML