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 a new instance of the MiniToolBar class.
public MiniToolBar()
Properties
CanUseMultiRowLayout
Gets or sets 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 isfalse
.
HasDropShadow
Gets or sets 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 isfalse
.
SeparatorBrush
Gets or sets the Brush to render separators.
UserInterfaceDensity
Gets or sets a UserInterfaceDensity that indicates how compact or spacious the UI should appear.
public UserInterfaceDensity UserInterfaceDensity { get; set; }
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
.
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.
Fields
CanUseMultiRowLayoutProperty
Identifies the CanUseMultiRowLayout dependency property. This field is read-only.
public static readonly DependencyProperty CanUseMultiRowLayoutProperty
HasDropShadowProperty
Identifies the HasDropShadow dependency property. This field is read-only.
public static readonly DependencyProperty HasDropShadowProperty
SeparatorBrushProperty
Identifies the SeparatorBrush dependency property. This field is read-only.
public static readonly DependencyProperty SeparatorBrushProperty
UserInterfaceDensityProperty
Identifies the UserInterfaceDensity dependency property. This field is read-only.
public static readonly DependencyProperty UserInterfaceDensityProperty