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:
trueif toolbars can float; otherwise,false. The default value istrue.
Child
The child UIElement to host in the control's center.
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.
ItemContainerTemplateSelector
The ItemContainerTemplateSelector that creates UI controls for bar control view models.
public ItemContainerTemplateSelector? ItemContainerTemplateSelector { get; set; }
Property Value
LineSpacing
The spacing between lines.
OuterPadding
The padding around the outside of the dock areas when a toolbar is in the dock area.
ToolBarItemSpacing
The amount of spacing between toolbar items.
ToolBarSpacing
The spacing between toolbars on the same line.
ToolBarsHaveGrippers
The default setting for whether toolbars have grippers.
public bool ToolBarsHaveGrippers { get; set; }
Property Value
- bool:
trueif toolbars have grippers by default; otherwise,false. The default value istrue.
ToolBarsHaveOptionsButtons
The default setting for whether toolbars have options buttons.
public bool ToolBarsHaveOptionsButtons { get; set; }
Property Value
- bool:
trueif toolbars have options buttons by default; otherwise,false. The default value istrue.
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:
trueif 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:
trueif 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.
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