ToolBarTray.ToolBars Property

 

Gets the collection of ToolBar elements in the ToolBarTray.

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

Public ReadOnly Property ToolBars As Collection(Of ToolBar)

Property Value

Type: System.Collections.ObjectModel.Collection(Of 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(Of T) object. XAML does not support declaring generic types.

<object>
  OneOrMoreToolBarElements
</object>

OneOrMoreToolBarElements

One or more ToolBar objects.

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

tbartray.ToolBars.Add(tbar)
tbartray.ToolBars.Add(tbar1)

.NET Framework
Available since 3.0
Return to top
Show: