ToolWindowContainer Class
Represents a container of one or more tool windows.
[TemplatePart(Name = "PART_Icon", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PART_OptionsButton", Type = typeof(PopupButton))]
[TemplatePart(Name = "PART_TitleBar", Type = typeof(FrameworkElement))]
[TemplateVisualState(Name = "Active", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Inactive", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "AutoHide", GroupName = "StateStates")]
[TemplateVisualState(Name = "Docked", GroupName = "StateStates")]
public class ToolWindowContainer : DockingWindowContainerBase, IDockTarget, IOrientedElement
- Inheritance:
- object Visual UIElement FrameworkElement Control DockingWindowContainerBase object
- Implements:
- IDockTarget IOrientedElement
Constructors
ToolWindowContainer()
Initializes an instance of the class.
public ToolWindowContainer()
Properties
AutoHideCommand
The ICommand that can auto-hide the windows in the container.
CloseButtonContentTemplate
The DataTemplate to use for the close button content.
CloseButtonToolTip
The text to be displayed as a tooltip for the close button, which is based on the string resource UIToolWindowContainerCloseButtonToolTip and can optionally include the key gesture for the action associated with the button.
public string? CloseButtonToolTip { get; }
Property Value
Remarks
The text of CloseKeyGesture will be passed as the first argument for string formatting, so {0} in the string resource will be replaced by the key gesture.
CloseCommand
The ICommand that can close the windows in the container.
CloseKeyGesture
The KeyGesture that is used to invoke the Close() method by default.
public KeyGesture? CloseKeyGesture { get; set; }
Property Value
- KeyGesture:
The default value is
Shift+Esc.
See Also
DockCommand
The ICommand that can dock the windows in the container.
EmbeddedButtonStyle
The Style to use for embedded buttons.
HasCloseButton
Indicates whether the container has a title bar close button if the SelectedWindow is closable.
HasTitleBarGripper
Indicates whether the titlebar has a gripper.
HasTitleBarIcon
Indicates whether the container is capable of displaying the selected window's icon in the title bar.
HasToggleAutoHideButton
Indicates whether the container has a title bar toggle auto-hide button if the SelectedWindow can auto-hide.
IsCloseButtonVisible
Indicates whether the container's close button is visible.
IsMaximizeButtonVisible
Indicates whether the container's maximize button is visible.
IsMinimizeButtonVisible
Indicates whether the container's minimize button is visible.
IsOptionsButtonVisible
Indicates whether the container's options button is visible.
IsRestoreButtonVisible
Indicates whether the container's restore button is visible.
IsToggleAutoHideButtonVisible
Indicates whether the container's toggle auto-hide button is visible.
MaximizeButtonContentTemplate
The DataTemplate to use for the maximize button content.
MaximizeCommand
The ICommand that can maximize the window that hosts the container.
MenuButtonContentTemplate
The DataTemplate to use for the drop-down menu button content.
MinimizeButtonContentTemplate
The DataTemplate to use for the minimize button content.
MinimizeCommand
The ICommand that can minimize the window that hosts the container.
OpenOptionsMenuKeyGesture
The KeyGesture that is used to invoke the OpenOptionsMenu() method by default.
public KeyGesture? OpenOptionsMenuKeyGesture { get; set; }
Property Value
- KeyGesture:
The default value is
Alt+-.
OptionsMenuButtonToolTip
The text to be displayed as a tooltip for the options menu button, which is based on the string resource UIToolWindowContainerOptionsButtonToolTip and can optionally include the key gesture for the action associated with the button.
public string? OptionsMenuButtonToolTip { get; }
Property Value
Remarks
The text of OpenOptionsMenuKeyGesture will be passed as the first argument for string formatting, so {0} in the string resource will be replaced by the key gesture.
PinButtonContentTemplate
The DataTemplate to use for the pin button content.
RestoreButtonContentTemplate
The DataTemplate to use for the restore button content.
RestoreCommand
The ICommand that can restore the window that hosts the container.
SelectedToolWindow
The ToolWindow that is currently selected in the container.
TitleBarContextContentAlignment
The alignment of title bar context content.
public ContextContentAlignment TitleBarContextContentAlignment { get; set; }
Property Value
- ContextContentAlignment:
The default value is Far.
TitleBarMinHeight
The title bar minimum height.
TitleFontFamily
The title's font family.
TitleFontSize
The title's font size.
TitleFontWeight
The title's font weight.
public FontWeight TitleFontWeight { get; set; }
Property Value
- FontWeight:
The default value is
Normal.
ToggleAutoHideCommand
The ICommand that can toggle the container between an auto-hide and docked state.
UnpinButtonContentTemplate
The DataTemplate to use for the unpin button content.
Windows
The collection of child DockingWindow objects.
public ObservableCollection<DockingWindow> Windows { get; }
Property Value
Methods
AutoHide()
Auto-hides the contained ToolWindow controls to the outer-edge of the ancestor DockHost.
public void AutoHide()
Remarks
Using this method places the contained ToolWindow controls in an AutoHideState.
Use the AutoHide(Side) method overload to auto-hide to a specific side.
AutoHide(Side)
Auto-hides the contained ToolWindow controls to the specified outer-edge of the ancestor DockHost.
public void AutoHide(Side side)
| Parameter | Type | Description |
|---|---|---|
| side | Side | A dock side indicating the side upon which to auto-hide. |
Remarks
Using this method places the contained ToolWindow controls in an AutoHideState.
Use the AutoHide() method overload to auto-hide to the control's default side.
Close()
Closes the tool windows in the container, removing them from the layout.
public bool Close()
Returns
- bool:
trueif all tool windows were closed successfully; otherwise,false.
Dock()
Docks the contained ToolWindow controls back to their default docked location.
public void Dock()
Remarks
Using this method places the contained ToolWindow controls in a DockedState.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnDockSiteChanged(DockSite?, DockSite?)
Called when the DockSite property is changed.
protected override void OnDockSiteChanged(DockSite? oldDockSite, DockSite? newDockSite)
| Parameter | Type | Description |
|---|---|---|
| oldDockSite | DockSite | The old value. |
| newDockSite | DockSite | The new value. |
OnKeyDown(KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown 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 OnKeyDown(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | The KeyEventArgs that contains the event data. |
OnTabControlMenuOpening(AdvancedTabControlMenuEventArgs)
Invoked when a menu on the tab control is opening.
protected override void OnTabControlMenuOpening(AdvancedTabControlMenuEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | AdvancedTabControlMenuEventArgs | The event data. |
OpenOptionsMenu()
Opens the options menu for the SelectedWindow.
public void OpenOptionsMenu()
OpenOptionsMenu(FrameworkElement?)
Opens the options menu for the SelectedWindow under the specified placement target element.
public void OpenOptionsMenu(FrameworkElement? placementTarget)
| Parameter | Type | Description |
|---|---|---|
| placementTarget | FrameworkElement | The optional FrameworkElement under which to open the menu. |
UpdateCommands()
Updates the enabled states of the commands.
protected override void UpdateCommands()
UpdateDockingWindowStates()
Updates the DockingWindowState associated with all child docking windows.
protected override void UpdateDockingWindowStates()
UpdateIsTabStripVisible()
Updates the IsTabStripVisible property.
protected override void UpdateIsTabStripVisible()
UpdateTitleBarButtonVisibility()
Updates the title bar button visibility.
protected override void UpdateTitleBarButtonVisibility()
UpdateVisualState(bool)
Updates the visual state.
protected override void UpdateVisualState(bool useTransitions)
| Parameter | Type | Description |
|---|---|---|
| useTransitions | bool | Whether to use transitions. |
ValidateChildType(DockingWindow)
Validates that the specified child DockingWindow type is valid for this container.
protected override void ValidateChildType(DockingWindow window)
| Parameter | Type | Description |
|---|---|---|
| window | DockingWindow | The DockingWindow to examine. |
Fields
CloseButtonContentTemplateProperty
Defines the CloseButtonContentTemplate property.
public static readonly DependencyProperty CloseButtonContentTemplateProperty
CloseButtonToolTipProperty
Defines the CloseButtonToolTip property.
public static readonly DependencyProperty CloseButtonToolTipProperty
CloseKeyGestureProperty
Defines the CloseKeyGesture property.
public static readonly DependencyProperty CloseKeyGestureProperty
EmbeddedButtonStyleProperty
Defines the EmbeddedButtonStyle property.
public static readonly DependencyProperty EmbeddedButtonStyleProperty
HasCloseButtonProperty
Defines the HasCloseButton property.
public static readonly DependencyProperty HasCloseButtonProperty
HasTitleBarGripperProperty
Defines the HasTitleBarGripper property.
public static readonly DependencyProperty HasTitleBarGripperProperty
HasTitleBarIconProperty
Defines the HasTitleBarIcon property.
public static readonly DependencyProperty HasTitleBarIconProperty
HasToggleAutoHideButtonProperty
Defines the HasToggleAutoHideButton property.
public static readonly DependencyProperty HasToggleAutoHideButtonProperty
IsCloseButtonVisibleProperty
Defines the IsCloseButtonVisible property.
public static readonly DependencyProperty IsCloseButtonVisibleProperty
IsMaximizeButtonVisibleProperty
Defines the IsMaximizeButtonVisible property.
public static readonly DependencyProperty IsMaximizeButtonVisibleProperty
IsMinimizeButtonVisibleProperty
Defines the IsMinimizeButtonVisible property.
public static readonly DependencyProperty IsMinimizeButtonVisibleProperty
IsOptionsButtonVisibleProperty
Defines the IsOptionsButtonVisible property.
public static readonly DependencyProperty IsOptionsButtonVisibleProperty
IsRestoreButtonVisibleProperty
Defines the IsRestoreButtonVisible property.
public static readonly DependencyProperty IsRestoreButtonVisibleProperty
IsToggleAutoHideButtonVisibleProperty
Defines the IsToggleAutoHideButtonVisible property.
public static readonly DependencyProperty IsToggleAutoHideButtonVisibleProperty
MaximizeButtonContentTemplateProperty
Defines the MaximizeButtonContentTemplate property.
public static readonly DependencyProperty MaximizeButtonContentTemplateProperty
MenuButtonContentTemplateProperty
Defines the MenuButtonContentTemplate property.
public static readonly DependencyProperty MenuButtonContentTemplateProperty
MinimizeButtonContentTemplateProperty
Defines the MinimizeButtonContentTemplate property.
public static readonly DependencyProperty MinimizeButtonContentTemplateProperty
OpenOptionsMenuKeyGestureProperty
Defines the OpenOptionsMenuKeyGesture property.
public static readonly DependencyProperty OpenOptionsMenuKeyGestureProperty
OptionsMenuButtonToolTipProperty
Defines the OptionsMenuButtonToolTip property.
public static readonly DependencyProperty OptionsMenuButtonToolTipProperty
PinButtonContentTemplateProperty
Defines the PinButtonContentTemplate property.
public static readonly DependencyProperty PinButtonContentTemplateProperty
RestoreButtonContentTemplateProperty
Defines the RestoreButtonContentTemplate property.
public static readonly DependencyProperty RestoreButtonContentTemplateProperty
TitleBarContextContentAlignmentProperty
Defines the TitleBarContextContentAlignment property.
public static readonly DependencyProperty TitleBarContextContentAlignmentProperty
TitleBarMinHeightProperty
Defines the TitleBarMinHeight property.
public static readonly DependencyProperty TitleBarMinHeightProperty
TitleFontFamilyProperty
Defines the TitleFontFamily property.
public static readonly DependencyProperty TitleFontFamilyProperty
TitleFontSizeProperty
Defines the TitleFontSize property.
public static readonly DependencyProperty TitleFontSizeProperty
TitleFontWeightProperty
Defines the TitleFontWeight property.
public static readonly DependencyProperty TitleFontWeightProperty
UnpinButtonContentTemplateProperty
Defines the UnpinButtonContentTemplate property.
public static readonly DependencyProperty UnpinButtonContentTemplateProperty
Inherited Members
- DockingWindowContainerBase.CanTabsCloseOnMiddleClickProperty
- DockingWindowContainerBase.HasTabImagesProperty
- DockingWindowContainerBase.IsActiveProperty
- DockingWindowContainerBase.IsTabLayoutAnimationEnabledProperty
- DockingWindowContainerBase.IsTabLayoutAnimationEnabledResolvedProperty
- DockingWindowContainerBase.IsTabStripVisibleProperty
- DockingWindowContainerBase.MaxTabExtentProperty
- DockingWindowContainerBase.MinTabExtentProperty
- DockingWindowContainerBase.SelectedWindowProperty
- DockingWindowContainerBase.SingleTabLayoutBehaviorProperty
- DockingWindowContainerBase.StateProperty
- DockingWindowContainerBase.TabControlStyleProperty
- DockingWindowContainerBase.TabItemContainerStyleProperty
- DockingWindowContainerBase.TabOverflowBehaviorProperty
- DockingWindowContainerBase.TabStripPlacementProperty
- DockingWindowContainerBase.OnSelectedWindowChanged(DockingWindow, DockingWindow)
- DockingWindowContainerBase.OnWindowsChanged(NotifyCollectionChangedEventArgs)
- DockingWindowContainerBase.ToString()
- DockingWindowContainerBase.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- DockingWindowContainerBase.CanTabsCloseOnMiddleClick
- DockingWindowContainerBase.DockHost
- DockingWindowContainerBase.DockSite
- DockingWindowContainerBase.HasTabImages
- DockingWindowContainerBase.IsActive
- DockingWindowContainerBase.IsTabLayoutAnimationEnabled
- DockingWindowContainerBase.IsTabLayoutAnimationEnabledResolved
- DockingWindowContainerBase.IsTabStripVisible
- DockingWindowContainerBase.MaxTabExtent
- DockingWindowContainerBase.MinTabExtent
- DockingWindowContainerBase.SelectedWindow
- DockingWindowContainerBase.SingleTabLayoutBehavior
- DockingWindowContainerBase.State
- DockingWindowContainerBase.TabControl
- DockingWindowContainerBase.TabOverflowBehavior
- DockingWindowContainerBase.TabStripPlacement
- DockingWindowContainerBase.WindowsCore
- DockingWindowContainerBase.LogicalChildren
- DockingWindowContainerBase.TabControlStyle
- DockingWindowContainerBase.TabItemContainerStyle