Back to Devexpress

ThemedWindow.HeaderItemsSource Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-3021a8ed.md

latest3.1 KB
Original Source

ThemedWindow.HeaderItemsSource Property

Gets or sets a collection of objects that provides information to generate and initialize header items for the current ThemedWindow object. This is a dependency property.

Namespace : DevExpress.Xpf.Core

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public IEnumerable HeaderItemsSource { get; set; }
vb
Public Property HeaderItemsSource As IEnumerable

Property Value

TypeDescription
IEnumerable

A source of objects to be visualized as header items.

|

Remarks

The ThemedWindow supports the MVVM approach. Use the HeaderItemsSource property to bind the ThemedWindow to a ViewModel’s header items collection. Pass the object collection to this property to initialize these items in a ThemedWindow ‘s header.

Use the ThemedWindow.HeaderItemTemplate property to visualize ThemedWindow ‘s header objects.

The following code snippet demonstrates how to use the HeaderItemsSource property to display Header Items in code:

csharp
themedwindow.HeaderItemsSource = new List<object>() { "code_1", "code_2", "code_3", new SimpleButton() { Content = "SimpleButton"}, new TextEdit() { NullText = "DX Text Edit"} };
vb
themedwindow.HeaderItemsSource = New List(Of objects)() With{
  "code_1", "code_2", "code_3",
  New SimpleButton() With {
    .Content = "SimpleButton" }
  New TextEdit() With {
    .NullText = "DX Text Edit" }
}

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.HeaderItemsSource>
      <dx:ThemedWindowHeaderItemsCollection>
          code_1
          code_2
          code_3
          <Button Content="SimpleButton"/>
          <dxe:TextEdit NullText="DX Text Edit"/>
      </dx:ThemedWindowHeaderItemsCollection>
  </dx:ThemedWindow.HeaderItemsSource>
</dx:ThemedWindow>

The image below illustrates the result:

See Also

HeaderItems

HeaderItemTemplate

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace