In This Article

DockableToolBar Class

Represents a toolbar control that can host bar controls and dock at locations within a DockableToolBarHost.

[TemplatePart(Name = "PART_Gripper", Type = typeof(DockableToolBarGripper))]
[TemplatePart(Name = "PART_Presenter", Type = typeof(ItemsPresenter))]
public class DockableToolBar : ItemsControl, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl object
Implements:
IOrientedElement

Constructors

DockableToolBar()

Initializes an instance of the DockableToolBar class.

public DockableToolBar()

Properties

CornerRadius

Gets or sets the corner radius of the control's border.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius:

The corner radius of the control's border.

FloatingLocation

Gets the location of the toolbar when floating, expressed as device dependent screen coordinates.

public Point FloatingLocation { get; }

Property Value

Point:

The location of the toolbar when floating, expressed as device dependent screen coordinates.

HasGripper

Gets or sets whether the toolbar has a gripper.

public bool? HasGripper { get; set; }

Property Value

bool?:

true if the toolbar has a gripper; otherwise, false. The default value is null, meaning inherit the value from the ToolBarsHaveGrippers property.

HasGripperResolved

Gets the resolved value for whether the toolbar has a gripper.

public bool HasGripperResolved { get; }

Property Value

bool:

true if the toolbar has a gripper; otherwise, false.

HasOptionsButton

Gets or sets whether the toolbar has an options button.

public bool? HasOptionsButton { get; set; }

Property Value

bool?:

true if the toolbar has an options button; otherwise, false. The default value is null, meaning inherit the value from the ToolBarsHaveOptionsButtons property.

HasOptionsButtonResolved

Gets the resolved value for whether the toolbar has an options button.

public bool HasOptionsButtonResolved { get; }

Property Value

bool:

true if the toolbar has an options button; otherwise, false.

IsFloating

Gets or sets whether the toolbar is floating.

public bool IsFloating { get; set; }

Property Value

bool:

true if the toolbar is floating; otherwise, false.

IsOverflowed

Gets whether the toolbar is overflowed, which is when it isn't large enough to display all items.

public bool IsOverflowed { get; }

Property Value

bool:

true if the toolbar is overflowed; otherwise, false.

ItemSpacing

Gets the amount of spacing between items.

public double ItemSpacing { get; }

Property Value

double:

The amount of spacing between items. The default value is 1.0.

Key

Gets or sets a string that uniquely identifies the control.

[Localizability(LocalizationCategory.NeverLocalize)]
public string Key { get; set; }

Property Value

string:

A string that uniquely identifies the control.

LineIndex

Gets or sets the index of the Placement line the toolbar is within.

public int LineIndex { get; set; }

Property Value

int:

The index of the Placement line the toolbar is within.

Offset

Gets or sets the anchor offset of the toolbar within its line.

public double Offset { get; set; }

Property Value

double:

The anchor offset of the toolbar within its line.

Orientation

Gets the orientation of the control, as determined by the toolbar's current Placement.

public Orientation Orientation { get; }

Property Value

Orientation:

The orientation of the control.

See Also

Placement

Gets or sets a Dock specifying the toolbar placement.

public Dock Placement { get; set; }

Property Value

Dock:

A Dock specifying the toolbar placement. The default value is Top.

SortOrder

Gets or sets the toolbar's sort order within its Placement line.

public int SortOrder { get; set; }

Property Value

int:

The toolbar's sort order within its Placement line.

Title

Gets or sets the toolbar's title.

public string Title { get; set; }

Property Value

string:

The toolbar's title.

ToggleVisibilityCommand

Gets the ICommand to toggle toolbar visibility.

public ICommand ToggleVisibilityCommand { get; }

Property Value

ICommand:

The ICommand to toggle toolbar visibility.

UserInterfaceDensity

Gets a UserInterfaceDensity that indicates how compact or spacious the UI should appear.

public UserInterfaceDensity UserInterfaceDensity { get; }

Property Value

UserInterfaceDensity:

A UserInterfaceDensity that indicates how compact or spacious the UI should appear. The default value is Compact.

Methods

ClearContainerForItemOverride(DependencyObject, object)

When overridden in a derived class, undoes the effects of the PrepareContainerForItemOverride(DependencyObject, object) method.

protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameter Type Description
element DependencyObject

The container element.

item object

The item.

GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

The element that is used to display the given item.

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own container.

protected override bool IsItemItsOwnContainerOverride(object item)
Parameter Type Description
item object

The item to check.

Returns

bool:

true if the item is (or is eligible to be) its own container; otherwise, false.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Invoked when an unhandled System.Windows.Input.Keyboard.PreviewGotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameter Type Description
e KeyboardFocusChangedEventArgs

The KeyboardFocusChangedEventArgs that contains the event data.

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).

protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

The event data that describes the property that changed, as well as old and new values.

PrepareContainerForItemOverride(DependencyObject, object)

Prepares the specified element to display the specified item.

protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameter Type Description
element DependencyObject

Element used to display the specified item.

item object

Specified item.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

CornerRadiusProperty

Identifies the CornerRadius dependency property. This field is read-only.

public static readonly DependencyProperty CornerRadiusProperty

FloatingLocationProperty

Identifies the FloatingLocation dependency property. This field is read-only.

public static readonly DependencyProperty FloatingLocationProperty

HasGripperProperty

Identifies the HasGripper dependency property. This field is read-only.

public static readonly DependencyProperty HasGripperProperty

HasGripperResolvedProperty

Identifies the HasGripperResolved dependency property. This field is read-only.

public static readonly DependencyProperty HasGripperResolvedProperty

HasOptionsButtonProperty

Identifies the HasOptionsButton dependency property. This field is read-only.

public static readonly DependencyProperty HasOptionsButtonProperty

HasOptionsButtonResolvedProperty

Identifies the HasOptionsButtonResolved dependency property. This field is read-only.

public static readonly DependencyProperty HasOptionsButtonResolvedProperty

IsFloatingProperty

Identifies the IsFloating dependency property. This field is read-only.

public static readonly DependencyProperty IsFloatingProperty

IsOverflowedProperty

Identifies the IsOverflowed dependency property. This field is read-only.

public static readonly DependencyProperty IsOverflowedProperty

ItemSpacingProperty

Identifies the ItemSpacing dependency property. This field is read-only.

public static readonly DependencyProperty ItemSpacingProperty

KeyProperty

Identifies the Key dependency property. This field is read-only.

public static readonly DependencyProperty KeyProperty

LineIndexProperty

Identifies the LineIndex dependency property. This field is read-only.

public static readonly DependencyProperty LineIndexProperty

OffsetProperty

Identifies the Offset dependency property. This field is read-only.

public static readonly DependencyProperty OffsetProperty

OrientationProperty

Identifies the Orientation dependency property. This field is read-only.

public static readonly DependencyProperty OrientationProperty

PlacementProperty

Identifies the Placement dependency property. This field is read-only.

public static readonly DependencyProperty PlacementProperty

SortOrderProperty

Identifies the SortOrder dependency property. This field is read-only.

public static readonly DependencyProperty SortOrderProperty

TitleProperty

Identifies the Title dependency property. This field is read-only.

public static readonly DependencyProperty TitleProperty

UserInterfaceDensityProperty

Identifies the UserInterfaceDensity dependency property. This field is read-only.

public static readonly DependencyProperty UserInterfaceDensityProperty