New to Telerik Reporting? Download free 30-day trial

WPF Report Viewer Takes Themes from the XAML Files


Product Version
Product Progress® Telerik® Reporting
Report Viewers WPF


Sometimes it is more convenient to refer the Themes for the WPF Report Viewer from the corresponding XAML files as opposed to Telerik.ReportViewer.Wpf.Themes.dll assembly introduced with Telerik Reporting


Add a folder (e.g. Themes) in the WPF Viewer project and copy the XAML files with the Themes there. The themes are distributed with Telerik Reporting and can be found in {Telerik Reporting installation folder}\Wpf\Themes, for example C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q2\Wpf\Themes.

The themes can be referred directly in the App.xaml file, or alternatively in the code behind.

  1. In the App.xaml instead of content of the <ResourceDictionary.MergedDictionaries> element from step 4 in the WPF Report Viewer Manual Setup article use the following (the example uses the Material theme):

    <Application.Resources >
        <ResourceDictionary Source="Themes/Material/System.Windows.xaml" />
        <ResourceDictionary Source="Themes/Material/Telerik.Windows.Controls.xaml" />
        <ResourceDictionary Source="Themes/Material/Telerik.Windows.Controls.Input.xaml" />
        <ResourceDictionary Source="Themes/Material/Telerik.Windows.Controls.Navigation.xaml" />
        <ResourceDictionary Source="Themes/Material/Telerik.ReportViewer.Wpf.xaml" />
        // YOU MAY ADD OTHER STYLES IN THE <ResourceDictionary> TAG :
  2. In the code behind use the following code that first clears the already merged dictionaries (if any), and then adds the new ones:

    public partial class ReportViewerWindow1 : Window
    static readonly string[] dictionaries = new[]
        public ReportViewerWindow1()
            MergeResourceDictionaries("Material"); // Set the required theme name here
        static void MergeResourceDictionaries(string theme)
            var mergedDictionaries = Application.Current.Resources.MergedDictionaries;
            foreach (var dictionary in dictionaries)
                var uri = string.Format(dictionary, theme);
                mergedDictionaries.Add(new ResourceDictionary()
                    Source = new Uri(uri, UriKind.RelativeOrAbsolute)
In this article