In This Article

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.

public ICommand AutoHideCommand { get; }

Property Value

ICommand

CloseButtonContentTemplate

The DataTemplate to use for the close button content.

public DataTemplate? CloseButtonContentTemplate { get; set; }

Property Value

DataTemplate

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

string

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.

public ICommand CloseCommand { get; }

Property Value

ICommand

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.

public ICommand DockCommand { get; }

Property Value

ICommand

EmbeddedButtonStyle

The Style to use for embedded buttons.

public Style? EmbeddedButtonStyle { get; set; }

Property Value

Style

HasCloseButton

Indicates whether the container has a title bar close button if the SelectedWindow is closable.

public bool HasCloseButton { get; set; }

Property Value

bool:

The default value is true.

HasTitleBarGripper

Indicates whether the titlebar has a gripper.

public bool HasTitleBarGripper { get; set; }

Property Value

bool:

The default value is false.

HasTitleBarIcon

Indicates whether the container is capable of displaying the selected window's icon in the title bar.

public bool HasTitleBarIcon { get; set; }

Property Value

bool:

The default value is false.

HasToggleAutoHideButton

Indicates whether the container has a title bar toggle auto-hide button if the SelectedWindow can auto-hide.

public bool HasToggleAutoHideButton { get; set; }

Property Value

bool:

The default value is true.

IsCloseButtonVisible

Indicates whether the container's close button is visible.

public bool IsCloseButtonVisible { get; }

Property Value

bool:

The default value is true.

IsMaximizeButtonVisible

Indicates whether the container's maximize button is visible.

public bool IsMaximizeButtonVisible { get; }

Property Value

bool:

The default value is false.

IsMinimizeButtonVisible

Indicates whether the container's minimize button is visible.

public bool IsMinimizeButtonVisible { get; }

Property Value

bool:

The default value is false.

IsOptionsButtonVisible

Indicates whether the container's options button is visible.

public bool IsOptionsButtonVisible { get; }

Property Value

bool:

The default value is true.

IsRestoreButtonVisible

Indicates whether the container's restore button is visible.

public bool IsRestoreButtonVisible { get; }

Property Value

bool:

The default value is false.

IsToggleAutoHideButtonVisible

Indicates whether the container's toggle auto-hide button is visible.

public bool IsToggleAutoHideButtonVisible { get; }

Property Value

bool:

The default value is true.

MaximizeButtonContentTemplate

The DataTemplate to use for the maximize button content.

public DataTemplate? MaximizeButtonContentTemplate { get; set; }

Property Value

DataTemplate

MaximizeCommand

The ICommand that can maximize the window that hosts the container.

public ICommand MaximizeCommand { get; }

Property Value

ICommand

MenuButtonContentTemplate

The DataTemplate to use for the drop-down menu button content.

public DataTemplate? MenuButtonContentTemplate { get; set; }

Property Value

DataTemplate

MinimizeButtonContentTemplate

The DataTemplate to use for the minimize button content.

public DataTemplate? MinimizeButtonContentTemplate { get; set; }

Property Value

DataTemplate

MinimizeCommand

The ICommand that can minimize the window that hosts the container.

public ICommand MinimizeCommand { get; }

Property Value

ICommand

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

string

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.

public DataTemplate? PinButtonContentTemplate { get; set; }

Property Value

DataTemplate

RestoreButtonContentTemplate

The DataTemplate to use for the restore button content.

public DataTemplate? RestoreButtonContentTemplate { get; set; }

Property Value

DataTemplate

RestoreCommand

The ICommand that can restore the window that hosts the container.

public ICommand RestoreCommand { get; }

Property Value

ICommand

SelectedToolWindow

The ToolWindow that is currently selected in the container.

public ToolWindow? SelectedToolWindow { get; }

Property Value

ToolWindow

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.

public double TitleBarMinHeight { get; set; }

Property Value

double

TitleFontFamily

The title's font family.

public FontFamily TitleFontFamily { get; set; }

Property Value

FontFamily

TitleFontSize

The title's font size.

public double TitleFontSize { get; set; }

Property Value

double

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.

public ICommand ToggleAutoHideCommand { get; }

Property Value

ICommand

UnpinButtonContentTemplate

The DataTemplate to use for the unpin button content.

public DataTemplate? UnpinButtonContentTemplate { get; set; }

Property Value

DataTemplate

Windows

The collection of child DockingWindow objects.

public ObservableCollection<DockingWindow> Windows { get; }

Property Value

ObservableCollection<DockingWindow>

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:

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

Extension Methods