Skip to main content

ThemedWindow.ToolbarItems Property

Gets the toolbar items collection displayed in the current ThemedWindow. This is a dependency property.

Namespace: DevExpress.Xpf.Core

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

NuGet Package: DevExpress.Wpf.Core


public ObservableCollection<object> ToolbarItems { get; }

Property Value

Type Description

A toolbar items collection.


Create a HeaderItemControl object and add it to the ToolbarItems collection to display an item within the ThemedWindow‘s toolbar area.

ToolbarItems and HeaderItems are not intended to be used with RibbonControl.


When the ToolbarItemsSource property is specified, the ThemedWindow ignores the ToolbarItems property.

The following code snippet shows how to add multiple toolbar items to a ThemedWindow in code:

using DevExpress.Xpf.Bars;
using System.Windows;

MainMenuControl menuControl = new MainMenuControl() { VerticalAlignment = VerticalAlignment.Center, ShowBackground = false };

BarSubItem subItem0 = new BarSubItem() { Content = "File"};
subItem0.Items.Add(new BarButtonItem() { Content = "New" });
subItem0.Items.Add(new BarButtonItem() { Content = "Open" });
subItem0.Items.Add(new BarButtonItem() { Content = "Exit" });

BarSubItem subItem1 = new BarSubItem() { Content = "Edit" };
subItem1.Items.Add(new BarButtonItem() { Content = "Copy" });
subItem1.Items.Add(new BarButtonItem() { Content = "Paste" });

menuControl.Items.Add(new BarButtonItem() { Content = "Help" });


The following code sample shows how to add the same toolbar items to a ThemedWindow in XAML:

<dx:ThemedWindow Title="ApplicationName" 
    <dxb:MainMenuControl VerticalAlignment="Center" ShowBackground="False">
        <dxb:BarSubItem Content="File">
            <dxb:BarButtonItem Content="New" />
            <dxb:BarButtonItem Content="Open" />
            <dxb:BarButtonItem Content="Exit" />
        <dxb:BarSubItem Content="Edit">
            <dxb:BarButtonItem Content="Copy" />
            <dxb:BarButtonItem Content="Paste" />
        <dxb:BarButtonItem Content="Help" />

The image below illustrates the result:

Themed Window - Toolbar Items property

See Also