Back to Devexpress

ThemeManager Class

wpf-devexpress-dot-xpf-dot-core-54dac85a.md

latest3.1 KB
Original Source

ThemeManager Class

Represents a theme manager, allowing you to apply themes.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
[DXLicenseWpfEditors]
public class ThemeManager :
    DependencyObject,
    IThemeManager
vb
<DXLicenseWpfEditors>
Public Class ThemeManager
    Inherits DependencyObject
    Implements IThemeManager

Remarks

DevExpress provides multiple themes that can be applied to all DevExpress controls for WPF and some standard controls (GroupBox, ScrollViewer, Scroll, RadoiButton, Button, ListBox, Slider, TabControl, Separator, ToggleButton, RepeatButton, Label, ListBoxItem, TabItem, ToolTip, etc).

To apply a theme, assign its name to the ThemeManager.ThemeName property.

xaml
<Window x:Class="WpfApplication5.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    Title="Window1" Height="300" Width="300"
    dx:ThemeManager.ThemeName="Office2007Black">
    <Grid>
        <dxg:GridControl Name="grid" Width="400" Height="270"
                         AutoPopulateColumns="True">
            <dxg:GridControl.View>
                <dxg:TableView AutoWidth="True"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>

To prevent theming of individual controls, set the ThemeManager.ThemeName attribute to ‘None’. The ‘DeepBlue’ theme is applied to a DevExpress control if the ThemeManager.ThemeName attribute is set to ‘None’.

xaml
<TextBox Name="textBox1" dx:ThemeManager.ThemeName="None"
            Width="120" Height="23"/>

Note

Lightweight themes work with the LightweightThemeManager and do not support the ThemeManager and its API.

Refer to the following help topic for more information: List of DevExpress WPF Themes.

Inheritance

Object DispatcherObject DependencyObject ThemeManager

See Also

ThemeManager Members

Theme List

DevExpress.Xpf.Core Namespace