Back to Devexpress

ThemedWindow.HeaderItems Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-42abc705.md

latest4.2 KB
Original Source

ThemedWindow.HeaderItems Property

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

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public ObservableCollection<object> HeaderItems { get; }
vb
Public ReadOnly Property HeaderItems As ObservableCollection(Of Object)

Property Value

TypeDescription
ObservableCollection<Object>

A header items collection.

|

Remarks

Create a HeaderItemControl object and add it to the HeaderItems collection to display an item within the ThemedWindow header.

HeaderItems and ToolbarItems are not intended to be used with the integrated RibbonControl or DXTabControl.

Note

When the HeaderItemsSource property is specified, the ThemedWindow ignores the HeaderItems property.

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

csharp
HeaderItems.Add(new HeaderItemControl() { Content = "HeaderItemControl" });
HeaderItems.Add(new SimpleButton() { Content = "SimpleButton" });
HeaderItems.Add(new TextEdit() { MinWidth = "200" });
vb
HeaderItems.Add(New HeaderItemControl() With{
  .Content = "HeaderItemControl" })
HeaderItems.Add(New SimpleButton() With{ 
  .Content = "SimpleButton" })
HeaderItems.Add(New TextEdit() With{ 
  .MinWidth = "200" })

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

xaml
<dx:ThemedWindow
...
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<dx:ThemedWindow.HeaderItems>
  <dx:HeaderItemControl Content="HeaderItemControl"/>
  <dx:SimpleButton Content="SimpleButton"/>
  <dxe:TextEdit NullText="Text Edit" MinWidth="200"/>
</dx:ThemedWindow.HeaderItems>
</dx:ThemedWindow>

The image below illustrates the result:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HeaderItems property.

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.

wpf-create-a-fluent-design-using-appearance-options/CS/FluentDesignTemplate/MainWindow.xaml#L36

xml
</dx:ThemedWindow.DataContext>
<dx:ThemedWindow.HeaderItems>
    <StackPanel Orientation="Horizontal" Margin="0,5,20,0">

See Also

HeaderItemsSource

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace