Version

Applying a Theme on a FrameworkElement Level (ThemeManager)

Topic Overview

Purpose

This topic describes how to apply a theme to a FrameworkElement using Infragistics ThemeManager™.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic explains the xamCalendar control and its modes and properties.

This topic provides a detailed overview of Infragistics ThemeManager and its main features.

In this topic

This topic contains the following sections:

Applying a Theme to xamCalendar - Example

Introduction

The following procedure walks you through the applying the Office2013 theme to the xamCalendar control using ThemeManager.

The procedure for applying a theme to a Window, Page, Grid or another FrameworkElement in the application is similar to the procedure below.

Preview

The following screenshot is a preview of the final result.

Applying_a_Theme_to_a_Control_1.png

Requirements

Following are the general requirements for applying the Office2013 theme to the XamCalendar control.

  • NuGet package references:

    • Infragistics.WPF.Calendar

    • Infragistics.WPF.Themes.Office2013

For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.

  • Namespaces:

    • A reference to the Infragistics® namespace: (xmlns:ig="http://schemas.infragistics.com/xaml")

Prerequisites

To complete the procedure, you need the following:

  • A Microsoft® Visual Studio® WPF project with a page

  • The required assembly references and namespaces added to the project (See the Requirements section above.)

Overview

Following is a conceptual overview of the process:

Steps

The following steps demonstrate how to apply the Office2013 theme to a xamCalendar control using ThemeManager.

Adding the xamCalendar control

Add the xamCalendar control to the root Grid container named GridContainer:

In XAML:

<ig:XamCalendar>
    <!-- Apply the Office2013 theme here ... -->
</ig:XamCalendar>

In C#:

var calendar = new XamCalendar();
GridContainer.Children.Add(calendar);

In Visual Basic:

Dim calendar = New XamCalendar()
GridContainer.Children.Add(calendar)

Applying the Office2013 theme

Apply the Office2013 theme to the xamCalendar control:

In XAML:

<ig:ThemeManager.Theme>
    <ig:Office2013Theme />
</ig:ThemeManager.Theme>

In C#:

ThemeManager.SetTheme(calendar, new Office2013Theme());

In Visual Basic:

ThemeManager.SetTheme(calendar, New Office2013Theme())

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic describes how to apply a theme to an application using Infragistics ThemeManager.

This topic describes how to enable/disable the theming of the supported Microsoft WPF controls using Infragistics ThemeManager.

This topic describes how to create and apply a new custom theme to a control using Infragistics ThemeManager.

This topic describes how to extend an existing control theme using the Infragistics ThemeManager.