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

The corner radius of the control's border.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

FloatingLocation

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

public Point FloatingLocation { get; }

Property Value

Point

HasGripper

Indicates 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

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

Indicates 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

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

Indicates whether the toolbar is floating.

public bool IsFloating { get; set; }

Property Value

bool:

true if the toolbar is floating; otherwise, false.

IsOverflowed

Indicates 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

The amount of spacing between items.

public double ItemSpacing { get; }

Property Value

double:

The default value is 1.0.

Key

A string that uniquely identifies the control.

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

Property Value

string

LineIndex

The index of the Placement line the toolbar is within.

public int LineIndex { get; set; }

Property Value

int

Offset

The anchor offset of the toolbar within its line.

public double Offset { get; set; }

Property Value

double

Orientation

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

public Orientation Orientation { get; }

Property Value

Orientation

See Also

Placement

A Dock specifying the toolbar placement.

public Dock Placement { get; set; }

Property Value

Dock:

The default value is Top.

SortOrder

The toolbar's sort order within its Placement line.

public int SortOrder { get; set; }

Property Value

int

Title

The toolbar's title.

public string? Title { get; set; }

Property Value

string

ToggleVisibilityCommand

The ICommand to toggle toolbar visibility.

public ICommand ToggleVisibilityCommand { get; }

Property Value

ICommand

UserInterfaceDensity

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

public UserInterfaceDensity UserInterfaceDensity { get; }

Property Value

UserInterfaceDensity:

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.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameter Type Description
e NotifyCollectionChangedEventArgs

Information about the change.

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

Defines the CornerRadius property.

public static readonly DependencyProperty CornerRadiusProperty

FloatingLocationProperty

Defines the FloatingLocation property.

public static readonly DependencyProperty FloatingLocationProperty

HasGripperProperty

Defines the HasGripper property.

public static readonly DependencyProperty HasGripperProperty

HasGripperResolvedProperty

Defines the HasGripperResolved property.

public static readonly DependencyProperty HasGripperResolvedProperty

HasOptionsButtonProperty

Defines the HasOptionsButton property.

public static readonly DependencyProperty HasOptionsButtonProperty

HasOptionsButtonResolvedProperty

Defines the HasOptionsButtonResolved property.

public static readonly DependencyProperty HasOptionsButtonResolvedProperty

IsFloatingProperty

Defines the IsFloating property.

public static readonly DependencyProperty IsFloatingProperty

IsOverflowedProperty

Defines the IsOverflowed property.

public static readonly DependencyProperty IsOverflowedProperty

ItemSpacingProperty

Defines the ItemSpacing property.

public static readonly DependencyProperty ItemSpacingProperty

KeyProperty

Defines the Key property.

public static readonly DependencyProperty KeyProperty

LineIndexProperty

Defines the LineIndex property.

public static readonly DependencyProperty LineIndexProperty

OffsetProperty

Defines the Offset property.

public static readonly DependencyProperty OffsetProperty

OrientationProperty

Defines the Orientation property.

public static readonly DependencyProperty OrientationProperty

PlacementProperty

Defines the Placement property.

public static readonly DependencyProperty PlacementProperty

SortOrderProperty

Defines the SortOrder property.

public static readonly DependencyProperty SortOrderProperty

TitleProperty

Defines the Title property.

public static readonly DependencyProperty TitleProperty

UserInterfaceDensityProperty

Defines the UserInterfaceDensity property.

public static readonly DependencyProperty UserInterfaceDensityProperty

Extension Methods