Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Theme Class

A WPF theme.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public class Theme :
    ITheme

#Remarks

You need to create a Theme class instance when you load and register a custom theme that you wish to use in a WPF application.

To do this, follow the steps below.

  1. Add a reference to an assembly that contains a custom theme.
  2. Create a Theme instance using the Theme constructor overload that takes two arguments: theme name (the one you have specified when creating the theme) and full name (includes namespace and version number) as shown below.

    Theme theme = new Theme("NewTheme");
    
  3. Specify the assembly name (matches the theme full name by default) using the Theme.AssemblyName property.
  4. Use the static Theme.RegisterTheme method to register the new theme in ThemeManager.
  5. Finally, apply the theme using the ThemeManager.SetTheme method.

All predefined themes shipped with DXperience subscriptions are already registered in the ThemeManager, so you do not need to create a Theme instance and register it manually.

To learn more, see List of DevExpress WPF Themes.

#Inheritance

Object
Theme
See Also