Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ToolBarTray.ToolBars Property


Gets the collection of ToolBar elements in the ToolBarTray.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public Collection<ToolBar> ToolBars { get; }

Property Value

Type: System.Collections.ObjectModel.Collection<ToolBar>

A collection of ToolBar objects.

You can add ToolBar objects to a ToolBarTray by using XAML, but do not use object element syntax. That is, do not explicitly specify the Collection<T> object. XAML does not support declaring generic types.



One or more ToolBar objects.

The following example shows how to use the ToolBars property to add a ToolBar to a ToolBarTray.


.NET Framework
Available since 3.0
Return to top
© 2017 Microsoft