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
Gets or sets whether toolbars can float.
public bool CanToolBarsFloat { get; set; }
Property Value
- bool:
true
if toolbars can float; otherwise,false
. The default value istrue
.
Child
Gets or sets the child UIElement to host in the control's center.
public UIElement Child { get; set; }
Property Value
CloneService
Gets or sets 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
Gets or sets the collection of variant size transitions to apply to all controls within the host's toolbars.
public VariantCollection ControlVariants { get; set; }
Property Value
- VariantCollection:
The collection of variant size transitions to apply to all controls within the host's toolbars.
ItemContainerTemplateSelector
Gets or sets the ItemContainerTemplateSelector that creates UI controls for bar control view models.
public ItemContainerTemplateSelector ItemContainerTemplateSelector { get; set; }
Property Value
- ItemContainerTemplateSelector:
The ItemContainerTemplateSelector that creates UI controls for bar control view models.
LineSpacing
Gets or sets the spacing between lines.
public double LineSpacing { get; set; }
Property Value
- double:
The spacing between lines. The default value is
1.0
.
OuterPadding
Gets or sets 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 padding around the outside of the dock areas when a toolbar is in the dock area. The default value is
1.0
.
ToolBarItemSpacing
Gets or sets the amount of spacing between toolbar items.
public double ToolBarItemSpacing { get; set; }
Property Value
- double:
The amount of spacing between toolbar items. The default value is
1.0
.
ToolBarSpacing
Gets or sets the spacing between toolbars on the same line.
public double ToolBarSpacing { get; set; }
Property Value
- double:
The spacing between toolbars on the same line. The default value is
1.0
.
ToolBarsHaveGrippers
Gets or sets 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 istrue
.
ToolBarsHaveOptionsButtons
Gets or sets 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 istrue
.
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.
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. |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Occurs when a property is changed.
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | DependencyPropertyChangedEventArgs | A System.Windows.DependencyPropertyChangedEventArgs 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 | DependencyObject | The target System.Windows.DependencyObject. |
Returns
- bool:
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 | 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
Identifies the CanToolBarsFloat dependency property. This field is read-only.
public static readonly DependencyProperty CanToolBarsFloatProperty
ChildProperty
Identifies the Child dependency property. This field is read-only.
public static readonly DependencyProperty ChildProperty
ControlVariantsProperty
Identifies the ControlVariants dependency property. This field is read-only.
public static readonly DependencyProperty ControlVariantsProperty
ItemContainerTemplateSelectorProperty
Identifies the ItemContainerTemplateSelector dependency property. This field is read-only.
public static readonly DependencyProperty ItemContainerTemplateSelectorProperty
LineSpacingProperty
Identifies the LineSpacing dependency property. This field is read-only.
public static readonly DependencyProperty LineSpacingProperty
MenuOpeningEvent
Identifies the MenuOpening routed event. This field is read-only.
public static readonly RoutedEvent MenuOpeningEvent
OuterPaddingProperty
Identifies the OuterPadding dependency property. This field is read-only.
public static readonly DependencyProperty OuterPaddingProperty
ToolBarItemSpacingProperty
Identifies the ToolBarItemSpacing dependency property. This field is read-only.
public static readonly DependencyProperty ToolBarItemSpacingProperty
ToolBarSpacingProperty
Identifies the ToolBarSpacing dependency property. This field is read-only.
public static readonly DependencyProperty ToolBarSpacingProperty
ToolBarsHaveGrippersProperty
Identifies the ToolBarsHaveGrippers dependency property. This field is read-only.
public static readonly DependencyProperty ToolBarsHaveGrippersProperty
ToolBarsHaveOptionsButtonsProperty
Identifies the ToolBarsHaveOptionsButtons dependency property. This field is read-only.
public static readonly DependencyProperty ToolBarsHaveOptionsButtonsProperty
UserInterfaceDensityProperty
Identifies the UserInterfaceDensity dependency property. This field is read-only.
public static readonly DependencyProperty UserInterfaceDensityProperty