In This Article

DockableToolBarHost Class

Represents a control that can host DockableToolBar around its central Child.

public class DockableToolBarHost : ItemsControl, IRootBarControl
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl object
Implements:
IRootBarControl

Constructors

DockableToolBarHost()

Initializes an instance of the class.

public DockableToolBarHost()

Properties

CanToolBarsFloat

Indicates whether toolbars can float.

public bool CanToolBarsFloat { get; set; }

Property Value

bool:

true if toolbars can float; otherwise, false. The default value is true.

Child

The child UIElement to host in the control's center.

public UIElement? Child { get; set; }

Property Value

UIElement

CloneService

The service used to clone objects.

public ICloneService CloneService { get; set; }

Property Value

ICloneService:

The ICloneService to be used. When not defined, a default BarsCloneService is used.

ControlVariants

The collection of variant size transitions to apply to all controls within the host's toolbars.

public VariantCollection? ControlVariants { get; set; }

Property Value

VariantCollection

ItemContainerTemplateSelector

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

public ItemContainerTemplateSelector? ItemContainerTemplateSelector { get; set; }

Property Value

ItemContainerTemplateSelector

LineSpacing

The spacing between lines.

public double LineSpacing { get; set; }

Property Value

double:

The default value is 1.0.

OuterPadding

The padding around the outside of the dock areas when a toolbar is in the dock area.

public Thickness OuterPadding { get; set; }

Property Value

Thickness:

The default value is 1.0.

ToolBarItemSpacing

The amount of spacing between toolbar items.

public double ToolBarItemSpacing { get; set; }

Property Value

double:

The default value is 1.0.

ToolBarSpacing

The spacing between toolbars on the same line.

public double ToolBarSpacing { get; set; }

Property Value

double:

The default value is 1.0.

ToolBarsHaveGrippers

The default setting for whether toolbars have grippers.

public bool ToolBarsHaveGrippers { get; set; }

Property Value

bool:

true if toolbars have grippers by default; otherwise, false. The default value is true.

ToolBarsHaveOptionsButtons

The default setting for whether toolbars have options buttons.

public bool ToolBarsHaveOptionsButtons { get; set; }

Property Value

bool:

true if toolbars have options buttons by default; otherwise, false. The default value is true.

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.

OnMenuOpening(BarMenuEventArgs)

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

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

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.

OpenContextMenuForElement(DependencyObject?)

Opens a programmatically-generated context menu for the specified object or one of its ancestor elements as appropriate.

public bool OpenContextMenuForElement(DependencyObject? sourceObj)
Parameter Type Description
sourceObj DependencyObject

The source System.Windows.DependencyObject to examine.

Returns

bool:

true if a 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 DependencyObject

Element used to display the specified item.

item object

Specified item.

Events

MenuOpening

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

public event EventHandler<BarMenuEventArgs> MenuOpening

Event Type

EventHandler<BarMenuEventArgs>

Fields

CanToolBarsFloatProperty

Defines the CanToolBarsFloat property.

public static readonly DependencyProperty CanToolBarsFloatProperty

ChildProperty

Defines the Child property.

public static readonly DependencyProperty ChildProperty

ControlVariantsProperty

Defines the ControlVariants property.

public static readonly DependencyProperty ControlVariantsProperty

ItemContainerTemplateSelectorProperty

Defines the ItemContainerTemplateSelector property.

public static readonly DependencyProperty ItemContainerTemplateSelectorProperty

LineSpacingProperty

Defines the LineSpacing property.

public static readonly DependencyProperty LineSpacingProperty

MenuOpeningEvent

Defines the MenuOpening routed event.

public static readonly RoutedEvent MenuOpeningEvent

OuterPaddingProperty

Defines the OuterPadding property.

public static readonly DependencyProperty OuterPaddingProperty

ToolBarItemSpacingProperty

Defines the ToolBarItemSpacing property.

public static readonly DependencyProperty ToolBarItemSpacingProperty

ToolBarSpacingProperty

Defines the ToolBarSpacing property.

public static readonly DependencyProperty ToolBarSpacingProperty

ToolBarsHaveGrippersProperty

Defines the ToolBarsHaveGrippers property.

public static readonly DependencyProperty ToolBarsHaveGrippersProperty

ToolBarsHaveOptionsButtonsProperty

Defines the ToolBarsHaveOptionsButtons property.

public static readonly DependencyProperty ToolBarsHaveOptionsButtonsProperty

UserInterfaceDensityProperty

Defines the UserInterfaceDensity property.

public static readonly DependencyProperty UserInterfaceDensityProperty

Extension Methods