Back to Devexpress

ThemedWindow.HeaderItemTemplate Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-4af3c901.md

latest3.0 KB
Original Source

ThemedWindow.HeaderItemTemplate Property

Gets or sets a template applied to the current ThemedWindow‘s header items. This is a dependency property.

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public DataTemplate HeaderItemTemplate { get; set; }
vb
Public Property HeaderItemTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A DataTemplate object applied to the current ThemedWindow‘s header items.

|

Remarks

The template assigned to the HeaderItemTemplate property is applied to items stored within the ThemedWindow.HeaderItems collection. To utilize multiple header item templates that switch based on custom logic, assign the required template selector to the ThemedWindow.HeaderItemTemplateSelector property.

Note

The HeaderItemTemplate property applies to all objects except UIElements objects.

The following code sample shows how to add ThemedWindow Header Items and change its’ HeaderItemTemplate :

xaml
<dx:ThemedWindow
  ...
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
  <dx:ThemedWindow.HeaderItemsSource>
      <dx:ThemedWindowHeaderItemsCollection>
          First
          Second
          Third
          <Button Content="SimpleButton"/>
      </dx:ThemedWindowHeaderItemsCollection>
  </dx:ThemedWindow.HeaderItemsSource>

  <dx:ThemedWindow.HeaderItemTemplate>
      <DataTemplate>
          <Border Margin="1" Background="Blue">
              <TextBlock Margin="5" Foreground="White" Text="{Binding}"/>
          </Border>
      </DataTemplate>
  </dx:ThemedWindow.HeaderItemTemplate>
</dx:ThemedWindow>

The image below illustrates the result:

Note

In this code snippet, the HeaderItemTemplate property applies to all objects except the Button control.

See Also

HeaderItems

HeaderItemsSource

HeaderItemTemplateSelector

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace