Back to Devexpress

ThemedWindow.ToolbarItemTemplate Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-3c38aaf2.md

latest2.9 KB
Original Source

ThemedWindow.ToolbarItemTemplate Property

Gets or sets a template applied to the current ThemedWindow‘s toolbar 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 ToolbarItemTemplate { get; set; }
vb
Public Property ToolbarItemTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A DataTemplate object applied to the current ThemedWindow’s toolbar items.

|

Remarks

The template assigned to the ToolbarItemTemplate property is applied to items stored within the ThemedWindow.ToolbarItems collection. To utilize multiple toolbar item templates that switch based on custom logic, assign the required template selector to the ThemedWindow.ToolbarItemTemplateSelector property.

Note

The ToolbarrItemTemplate property applies to all objects except UIElements objects.

The following code sample shows how to add ThemedWindow Toolbar Items and change its’ ToolbarItemTemplate :

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

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

The image below illustrates the result:

Note

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

See Also

ToolbarItems

ToolbarItemsSource

ToolbarItemTemplateSelector

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace