Skip to main content

StyleManager Class

A style manager, allowing you to apply themes.

Namespace: DevExpress.Xpf.Core

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

#Declaration

public static class StyleManager

#Remarks

The StyleManager allows you to apply the predefined theme (designed by DevExpress) assigned to individual controls (standard or developed by DevExpress), to the entire application.

NOTE

To use DevExpress themes, you must reference the corresponding assemblies (e.g. DevExpress.Xpf.Themes.Office2007Blue.v14.2.dll).

To apply a theme to all controls (standard and DevExpress), do the following:

  • Set the root element's ThemeManager.ApplyApplicationTheme attached property to true.

    
    <Grid x:Name="LayoutRoot" dxcore:StyleManager.ApplyApplicationTheme="True">
        <StackPanel Orientation="Vertical">
            <dxeditors:ButtonEdit Text="Nathan Miles"
                                  Width="120" Margin="5"/>
            <Button Content="Standard Button" Width="120" Margin="5"/>
        </StackPanel>
    </Grid>
    
  • Specify the required theme. Note - this should be done in code behind:

    
    using System.Windows.Controls;
    using DevExpress.Xpf.Core;
    
    public partial class MainPage : UserControl {
        public MainPage() {
            StyleManager.ApplicationTheme = Theme.Office2007Blue;
            InitializeComponent();
        }
    }
    

To learn more, see DevExpress Silverlight Themes.

#Inheritance

Object
StyleManager
See Also