wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-a74b413a.md
Gets or sets a collection of objects that provides information to generate and initialize toolbar 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
public IEnumerable ToolbarItemsSource { get; set; }
Public Property ToolbarItemsSource As IEnumerable
| Type | Description |
|---|---|
| IEnumerable |
A source of objects to be visualized as toolbar items.
|
The ThemedWindow supports the MVVM approach. Use the ToolbarItemsSource property to bind the ThemedWindow to a ViewModel’s toolbar items collection. Pass the object collection to this property to initialize these items in a ThemedWindow ‘s toolbar area.
Use the ThemedWindow.ToolbarItemTemplate property to visualize ThemedWindow ‘s toolbar objects.
The following code snippet demonstrates how to use the ToolbarItemsSource property to display Toolbar Items in code:
themedwindow.ToolbarItemsSource = new List<object>() {
"code_1", "code_2", "code_3", new SimpleButton() { Content = "SimpleButton"}, new TextEdit() { NullText = "DX Text Edit"} };
themedwindow.ToolbarItemsSource = 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 toolbar items to a ThemedWindow in 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.ToolbarItemsSource>
<dx:ThemedWindowHeaderItemsCollection>
code_1
code_2
code_3
<Button Content="SimpleButton"/>
<dxe:TextEdit NullText="DX Text Edit"/>
</dx:ThemedWindowHeaderItemsCollection>
</dx:ThemedWindow.ToolbarItemsSource>
</dx:ThemedWindow>
The image below illustrates the result:
See Also