This is the sixth and final topic in a multi-part walkthrough that continues from Modifying the AssemblyInfo File. In this topic we will show how to reference the newly created ThemePack to style the xamDataGrid™.
- In the Solution Explorer, right click the solution and click Add, then click New Project… Name the project "ThemePackTestProject."
- Add a New Folder to the project called "Data" and place the Orders.xml file inside it.
- Right click on the References node and select Add Reference… Navigate to the NetAdvantage for WPF install folder and select the following three assemblies from the Bin
- Infragistics3.Wpf.DataPresenter.v7.2.dll
- Infragistics3.Wpf.Editors.v7.2.dll
- Infragistics3.Wpf.v7.2.dll
- Add a reference to the assembly that the MyThemePack project generated.
- In the Window1.xaml file, place the following namespace declaration inside the opening Window tag.
In XAML:
...xmlns:igDP="http://infragistics.com/DataPresenter"xmlns:igThemeOrangePeel="http://infragistics.com/Themes/OrangePeel" ...
- Create a Window Resources section defining a MergedDictionary object. This will expose all the styles from the ThemePack.
In XAML:
<Window.Resources><ResourceDictionary><ResourceDictionary.MergedDictionaries><igThemeOrangePeel:DataPresenter/></ResourceDictionary.MergedDictionaries></ResourceDictionary></Window.Resources>
- Create a resources section for the Grid panel defining an XmlDataProvider. The XmlDataProvider references the Orders XML file.
In XAML:
<Grid.Resources><XmlDataProviderSource="../Data/Orders.xml"x:Key="OrderData"XPath="/Orders"/></Grid.Resources>
- Create an instance of XamDataGrid, name it, and set its DataSource to the XmlDataProvider created in the previous step.
In XAML:
<igDP:XamDataGridx:Name="XamDataGrid1"DataSource="{Binding Source={StaticResource OrderData}, XPath=Order}"/>
- Before running the project, right click ThemePackTestProject and click Set as StartUp Project.
- Run the project. When the mouse hovers over Records, they should be highlighted with a gold gradient.

