Getting Started with WPF ToolBar (ToolBarAdv)

Important
Starting with v16.2.0.x, if you refer to Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to this link to learn about registering Syncfusion license key in your WPF application to use our components.

This section explains how to add the ToolBarAdv control to an application and its structure.

Adding ToolBarAdv to a WPF Application

ToolBarAdv can be added to an application in a following way.

Create the ToolBarAdv Control to an application by using XAML:

The following ways explains how to add ToolBarAdv control using XAML code:

  • Create a WPF project in Visual Studio and refer “Syncfusion.Shared.Wpf” assembly to the project.
  • Include an XML namespace for the above assemblies to the Main window.
<Window x:Class="Application_New.MainWindow"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:syncfusion="http://schemas.syncfusion.com/wpf"

Title="MainWindow" Height="350" Width="525">
  • Now add the ToolBarAdv control with a required optimal name using the namespace
<syncfusion:ToolBarAdv Height="100" HorizontalAlignment="Left" Margin="92,90,0,0" Name="toolBarAdv1" VerticalAlignment="Top" Width="200" />

Create the ToolBarAdv control to an application by C#:

ToolBarAdv tool = new ToolBarAdv();

tool.Name = "toolBarAdv1";

tool.Width = 100;

tool.Height = 50;

Appearance and Structure of the Control

  • The Overflow button is a toggle button that displays on clicking the Overflow panel.
  • The Gripper is used to drag the ToolBarAdv to change its Band. The state of the ToolBarAdv can be changed to float and dock by clicking the gripper and dragging the ToolBarAdv, when the ToolBarAdv is hosted in ToolBarManager.

Properties

Properties of ToolBarAdv

Property

Description

Type

Data Type

Band

Gets or sets a value indicating where the ToolBarAdv should be placed in the ToolBarTrayAdv.

Dependency Property

Int

BandIndex

Gets or sets the band index number indicating the position of the ToolBarAdv on the band.

Dependency Property

Int

ToolBarName

Gets or sets the name of the ToolBarAdv.

Dependency Property

String

GripperVisibility

Gets or sets a value indicating whether gripper can be visible.

Dependency Property

Bool

FloatingBarLocation

Gets or sets the location for the floating ToolBarAdv.

Dependency Property

Point

ControlsResourceDictionary

Gets or sets resource dictionary in which ToolBarAdv will look up for Framework element’s styles.

Dependency Property

Resource Dictionary

IsOverflowOpen

Gets or sets a value indicating whether overflow popup is open.

Dependency Property

Bool

ToolBarItemInfoCollection

Gets or sets the items to be displayed in the Add or Remove Buttons popup.

Dependency Property

ObservableCollection

IsOverflowItem

Gets or sets a value indicating whether an item can be displayed in overflow panel.

Attached Property

Bool

OverflowMode

Gets or sets an overflow mode for a specified item.

Attached Property

OverflowMode

Icon

Gets or sets an icon for specified item to be displayed in the Add or Remove Buttons menu.

Attached Property

ImageSource

Label

Gets or sets a label for specified item to be displayed in the Add or Remove Buttons menu.

Attached Property

String

IsAvailable

Gets or sets a value indicating whether a specified item should be hidden.

Attached Property

Boolean

Properties of ToolBarManager

Property

Description

Type

Data Type

IsLocked

Gets or Sets a value indicating whether ToolBarTrayAdv is locked.

Dependency property

bool

Orientation

Gets or Sets the orientation of the ToolBarAdv.

Dependency property

Orientation

ToolBars

Gets or sets toolbars.

Dependency property

ObservableCollection

TopToolBarTray

Gets or sets ToolBarTrayAdv which has to be displayed at the Top of ToolBarManager.

Dependency Property

ToolBarTrayAdv

BottomToolBarTray

Gets or sets ToolBarTrayAdv which has to be displayed at the bottom of ToolBarManager.

Dependency Property

ToolBarTrayAdv

LeftToolBarTray

Gets or sets ToolBarTrayAdv which has to be displayed at the left of ToolBarManager.

Dependency Property

ToolBarTrayAdv

RightToolBarTray

Gets or sets ToolBarTrayAdv which has to be displayed at the right of ToolBarManager.

Dependency Property

ToolBarTrayAdv

CanDockAtTop

Gets or sets a value indicating whether toolbar can be docked at the top.

Dependency Property

bool

CanDockAtBottom

Gets or sets a value indicating whether toolbar can be docked at the bottom.

Dependency Property

bool

CanDockAtLeft

Gets or sets a value indicating whether toolbar can be docked at the left.

Dependency Property

bool

CanDockAtRight

Gets or sets a value indicating whether toolbar can be docked at the right.

Dependency Property

bool

Content

Gets or sets the content of the ToolBarManager.

Dependency Property

UIElement

FloatingToolBarStyle

Gets or sets a style of floating tool bar

Dependency Property

Style

ToolBarState

Gets or sets the state of the toolbar.

Attached Property

ToolBarState