In This Article

MiniToolBar Class

Represents a mini-toolbar control, optionally used within a BarContextMenu.

public class MiniToolBar : ItemsControl, IPopupAnchor, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl object
Implements:
IPopupAnchor IOrientedElement

Constructors

MiniToolBar()

Initializes an instance of the class.

public MiniToolBar()

Properties

CanUseMultiRowLayout

Indicates whether the items can be arranged in a multi-row layout.

public bool CanUseMultiRowLayout { get; set; }

Property Value

bool:

true if the items can be arranged in a multi-row layout; otherwise, false. The default value is false.

HasDropShadow

Indicates whether the mini-toolbar displays a drop shadow.

public bool HasDropShadow { get; set; }

Property Value

bool:

true if the mini-toolbar displays a drop shadow; otherwise, false. The default value is false.

SeparatorBrush

The Brush to render separators.

public Brush? SeparatorBrush { get; set; }

Property Value

Brush

UserInterfaceDensity

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

public UserInterfaceDensity UserInterfaceDensity { get; set; }

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.

OnContextMenuOpening(ContextMenuEventArgs)

Invoked whenever an unhandled ContextMenuOpening routed event reaches this class in its route. Implement this method to add class handling for this event.

protected override void OnContextMenuOpening(ContextMenuEventArgs e)
Parameter Type Description
e ContextMenuEventArgs

The RoutedEventArgs that contains the event data.

OnCreateAutomationPeer()

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

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)

Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. Implement this method to add class handling for this event.

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

A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

OnMouseDown(MouseButtonEventArgs)

Invoked when an unhandled System.Windows.Input.Mouse.MouseDown 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 OnMouseDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. This event data reports details about the mouse button that was pressed and the handled state.

OnPreviewMouseDown(MouseButtonEventArgs)

Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseDown attached routed 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 OnPreviewMouseDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that one or more mouse buttons were pressed.

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

CanUseMultiRowLayoutProperty

Defines the CanUseMultiRowLayout property.

public static readonly DependencyProperty CanUseMultiRowLayoutProperty

HasDropShadowProperty

Defines the HasDropShadow property.

public static readonly DependencyProperty HasDropShadowProperty

SeparatorBrushProperty

Defines the SeparatorBrush property.

public static readonly DependencyProperty SeparatorBrushProperty

UserInterfaceDensityProperty

Defines the UserInterfaceDensity property.

public static readonly DependencyProperty UserInterfaceDensityProperty

Extension Methods