In This Article

StandaloneToolBar Class

Represents a standalone toolbar control that can host bar controls, and is a replacement for a native ToolBar.

[TemplatePart(Name = "PART_OverflowPanel", Type = typeof(StandaloneToolBarOverflowPanel))]
public class StandaloneToolBar : ItemsControl, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IAddChild, IGeneratorHost, IContainItemStorage, IOverflowingItemsControl, IRootBarControl, IVariantSizeItemContainer, IOrientedElement
Inheritance:
System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control System.Windows.Controls.ItemsControl Object
Implements:
IOverflowingItemsControl IRootBarControl IOrientedElement

Constructors

StandaloneToolBar()

Initializes a new instance of the StandaloneToolBar class.

public StandaloneToolBar()

Properties

CornerRadius

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

public CornerRadius CornerRadius { get; set; }

Property Value

System.Windows.CornerRadius:

The corner radius of the control's border.

HasShadow

Gets or sets whether the toolbar has a shadow.

public bool HasShadow { get; set; }

Property Value

System.Boolean:

true if the toolbar has a shadow; 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

System.Boolean:

true if the toolbar is overflowed; otherwise, false.

ItemContainerTemplateSelector

Gets or sets the System.Windows.Controls.ItemContainerTemplateSelector that creates UI controls for bar control view models.

public ItemContainerTemplateSelector ItemContainerTemplateSelector { get; set; }

Property Value

System.Windows.Controls.ItemContainerTemplateSelector:

The System.Windows.Controls.ItemContainerTemplateSelector that creates UI controls for bar control view models.

ItemSpacing

Gets or sets the amount of spacing between items.

public double ItemSpacing { get; set; }

Property Value

System.Double:

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

Orientation

Gets or sets the orientation of the control.

public Orientation Orientation { get; set; }

Property Value

System.Windows.Controls.Orientation:

The orientation of the control.

OverflowButtonToolTip

Gets the tooltip for the overflow button.

public object OverflowButtonToolTip { get; set; }

Property Value

System.Object:

The tooltip for the overflow button.

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 System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject, System.Object) method.

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

The container element.

item System.Object

The item.

GetContainerForItemOverride()

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

protected override DependencyObject GetContainerForItemOverride()

Returns

System.Windows.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 System.Object

The item to check.

Returns

System.Boolean:

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()

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 System.Windows.Controls.ContextMenuEventArgs

The System.Windows.RoutedEventArgs that contains the event data.

OnCreateAutomationPeer()

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

protected override AutomationPeer OnCreateAutomationPeer()

Returns

System.Windows.Automation.Peers.AutomationPeer:

The type-specific System.Windows.Automation.Peers.AutomationPeer implementation.

OnMenuOpening(BarMenuEventArgs)

Occurs before a generated menu is opened, allowing for customization.

protected virtual void OnMenuOpening(BarMenuEventArgs e)
Parameter Type Description
e BarMenuEventArgs

The BarMenuEventArgs that contains the event data.

OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Invoked when an unhandled 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 System.Windows.Input.KeyboardFocusChangedEventArgs

The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.

OpenContextMenuForElement(DependencyObject)

Opens a context menu for the specified System.Windows.DependencyObject.

public bool OpenContextMenuForElement(DependencyObject sourceObj)
Parameter Type Description
sourceObj System.Windows.DependencyObject

The target System.Windows.DependencyObject.

Returns

System.Boolean:

true if a context menu was opened; otherwise, false.

PrepareContainerForItemOverride(DependencyObject, Object)

Prepares the specified element to display the specified item.

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

Element used to display the specified item.

item System.Object

Specified item.

ToString()

Provides a string representation of the System.Windows.Controls.ItemsControl object.

public override string ToString()

Returns

System.String:

The string representation of the object.

Events

MenuOpening

Occurs before a generated menu is opened, allowing for customization.

public event EventHandler<BarMenuEventArgs> MenuOpening

Event Type

System.EventHandler<BarMenuEventArgs>

Explicit Interface Implementations

IOverflowingItemsControl.get_Items()

ItemCollection IOverflowingItemsControl.get_Items()

Returns

System.Windows.Controls.ItemCollection

IOverflowingItemsControl.IsOverflowed

Gets or sets whether the control currently has overflowed items.

bool IOverflowingItemsControl.IsOverflowed { get; set; }

Returns

System.Boolean:

true if the control currently has overflowed items; otherwise, false.

IOverflowingItemsControl.ItemsHostPanel

Gets or sets the OverflowingItemsControlPanel used to host items within the main control.

OverflowingItemsControlPanel IOverflowingItemsControl.ItemsHostPanel { get; set; }

Returns

OverflowingItemsControlPanel:

The OverflowingItemsControlPanel used to host items within the main control.

IOverflowingItemsControl.OverflowPanel

Gets the OverflowingItemsControlOverflowPanel used to host overflowing items within a popup.

OverflowingItemsControlOverflowPanel IOverflowingItemsControl.OverflowPanel { get; }

Returns

OverflowingItemsControlOverflowPanel:

The OverflowingItemsControlOverflowPanel used to host overflowing items within a popup.

IRootBarControl.NotifyMenuOpening(BarMenuItem)

Notifies the bar control that a menu item's submenu is opening.

bool IRootBarControl.NotifyMenuOpening(BarMenuItem menuItem)
Parameter Type Description
menuItem BarMenuItem

The BarMenuItem whose submenu is opening.

Returns

System.Boolean:

true if the menu should be allowed to open; otherwise, false.

IRootBarControl.NotifyMenuOpening(BarPopupButtonBase)

Notifies the bar control that a popup button's menu is opening.

bool IRootBarControl.NotifyMenuOpening(BarPopupButtonBase popupButton)
Parameter Type Description
popupButton BarPopupButtonBase

The BarPopupButtonBase whose menu is opening.

Returns

System.Boolean:

true if the menu should be allowed to open; otherwise, false.

Fields

CornerRadiusProperty

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

public static readonly DependencyProperty CornerRadiusProperty

HasShadowProperty

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

public static readonly DependencyProperty HasShadowProperty

IsOverflowedProperty

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

public static readonly DependencyProperty IsOverflowedProperty

ItemContainerTemplateSelectorProperty

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

public static readonly DependencyProperty ItemContainerTemplateSelectorProperty

ItemSpacingProperty

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

public static readonly DependencyProperty ItemSpacingProperty

MenuOpeningEvent

Identifies the MenuOpening routed event. This field is read-only.

public static readonly RoutedEvent MenuOpeningEvent

OrientationProperty

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

public static readonly DependencyProperty OrientationProperty

OverflowButtonToolTipProperty

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

public static readonly DependencyProperty OverflowButtonToolTipProperty

UserInterfaceDensityProperty

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

public static readonly DependencyProperty UserInterfaceDensityProperty

Inherited Members

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object, System.Object)
  • System.Object.ReferenceEquals(System.Object, System.Object)
  • System.Object.GetHashCode()
  • System.Object.GetType()
  • System.Object.MemberwiseClone()

Extension Methods