Skip to main content

ThemedWindow Class

A window that supports DevExpress WPF themes and Ribbon/Tab control integration.

Namespace: DevExpress.Xpf.Core

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

NuGet Package: DevExpress.Wpf.Core

Declaration

public class ThemedWindow :
    Window,
    IRibbonWindow,
    IHeaderItemsControlHost,
    IBackButtonSupport,
    IWindowSurrogate

The following members return ThemedWindow objects:

Remarks

The ThemedWindow is a Window class descendant that supports DevExpress WPF themes.

ThemedWindow-ribbon-tab

Enable ThemedWindow

In Code

Follow the steps below to replace the standard Window class with the ThemedWindow:

  1. Change this:

    public partial class MainWindow : Window {
         //...
    }
    

    to this:

    using DevExpress.Xpf.Core;
    public partial class MainWindow : ThemedWindow {
         //...
    }
    
  2. Change this:

    <Window x:Class="Example.MainWindow"
    

    to this:

    <dx:ThemedWindow x:Class="Example.MainWindow"
    
  3. Add the missing reference:

    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    

With the Smart Tag

Select a window, click its Smart Tag, and click Convert to ThemedWindow. This converts the current Window to the ThemedWindow and updates XAML and CS files:

SmartTagsConvertTo

Integrate the Ribbon / Tab Control

Add the RibbonControl or TabControl to your application and specify the ThemedWindow.WindowKind property to integrate the control into the ThemedWindow:

<dx:ThemedWindow 
        ...
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
        xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
        WindowKind="Auto">
    <Grid>
        <dxr:RibbonControl RibbonStyle="Office2010">
            <!-- RibbonControl content -->
        </dxr:RibbonControl>
    </Grid>
</dx:ThemedWindow>

Note

The RibbonControl parent element’s Background property must be set to null.

Customize the ThemedWindow

Acrylic Effect

Acrylic makes the ThemedWindow (including title bar) translucent to add a depth effect.

Set the ThemedWindow.EnableAcrylic to true to enable the Acrylic effect. You can use the ThemedWindow.AcrylicOpacity and ThemedWindow.AcrylicColor properties to customize ThemedWindow opacity and color.

WPF Acrylic Window - Color Property

Header / Toolbar Items

The ThemedWindow allows you to display items in the window’s header area:

WPF Themed Window - Header / Toolbar Items

Refer to the ThemedWindow.HeaderItems or ThemedWindow.ToolbarItems property descriptions for a code sample.

Full Height Side Panel

The ThemedWindow can display a container at its left side (Side Panel). This panel occupies the entire window height. All header elements (window icon, title, items, and so on) are displayed to the right of the Side Panel. Set the ShowLeftPanel property to true to display the Side Panel.

WPF ThemedWindow - Full Height Side Panel

LeftPanelContent, LeftPanelContentTemplate, and LeftPanelContentTemplateSelector properties allow you to specify panel content.

Refer to the LeftPanelContent property description for a code sample.

Header Colors

You can use the ThemedWindow.HeaderBackground and ThemedWindow.HeaderForeground properties to specify Header Background and Foreground colors when the window is active.

WPF Themed Window - Header Background / Foreground

<dx:ThemedWindow
    ...
    HeaderBackground="DodgerBlue"
    HeaderForeground="White">
    ...
</dx:ThemedWindow>

Glow Colors

Set ThemedWindow.UseGlowColors to true to use custom colors for the window’s glow effect. Use the ThemedWindow.ActiveGlowColor and ThemedWindow.InactiveGlowColor properties to specify glow effect colors for active and inactive windows.

WPF Themed Window - Glow Colors

Note

The ThemedWindow.UseGlowColors is in effect only if the ThemedWindow.ShowGlow property is true.

Window Buttons

Use the ThemedWindow.ControlBoxButtonSet property to specify which buttons are displayed in the window’s control box:

ThemedWindow ControlboxButtonsSet Property Result

<dx:ThemedWindow
  ...
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
  ControlBoxButtonSet="Close,MaximizeRestore">
  ...
</dx:ThemedWindow>

Round Corners

Set the static RoundCorners property to true to round ThemedWindow corners.

using DevExpress.Xpf.Core;
//...

public partial class App {
    protected override void OnStartup(StartupEventArgs e) {
        base.OnStartup(e);
        ThemedWindow.RoundCorners = true;  
    }
}

WPF Controls - ThemedWindow | Rounded Corners

Save and Restore the ThemedWindow

You can use the CurrentWindowSerializationBehavior to serialize/deserialize ThemedWindow settings. Refer to the behavior description for more information and examples.

The WindowRestoreLayoutOptions class contains attached properties that allow you to modify the deserialization process.

ThemedWindowDialog

Use the ShowDialog method overloads to display a ThemedWindowDialog.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ThemedWindow class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also