RadDock
Represents the major control in the Telerik.WinForms.UI.Docking assembly. Root component for the entire docking framework. Provides highly extensible and completely transparent transaction-based API for managing a set of tool and document windows registered within the docking framework. Mimics the user experience found in Microsoft Visual Studio - dockable panes, tabbed documents, document navigation plus much more.
Definition
Namespace:Telerik.WinControls.UI.Docking
Assembly:Telerik.WinControls.RadDock.dll
Syntax:
[TelerikToolboxCategory("Containers")]
public class RadDock : RadSplitContainer, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, ILoadObsoleteDockingManagerXml, IMessageListener
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlSplitPanelRadSplitContainerRadDock...
Implements:
Inherited Members
Constructors
Fields
public const string DockSplitContainerThemeClassName = "DockSplitContainer"
Properties
Gets a read-only collection of all active floating windows managed by this RadDock instance.
[Browsable(false)]
public ReadOnlyCollection<FloatingWindow> ActiveFloatingWindows { get; }
This property provides access to all floating windows that contain valid dock windows. Floating windows that are disposed or don't contain valid dock windows are filtered out. This collection is useful for operations that need to work with only the currently active floating windows.
Gets or sets the DockWindow instance, which is currently active (meaning it contains the Keyboard focus).
[Browsable(false)]
public DockWindow ActiveWindow { get; set; }
Gets or sets a value indicating whether [auto detect MDI child].
public bool AutoDetectMdiChildren { get; set; }
true if [auto detect MDI child]; otherwise, false.
Determines what animation will be used when displaying/hiding auto-hidden windows.
public AutoHideAnimateMode AutoHideAnimation { get; set; }
Gets or sets the duration of the auto hide window animation. The default value is 200 milliseconds.
[Browsable(false)]
public int AutoHideAnimationDuration { get; set; }
The duration of the auto hide window animation. The default value is 200 milliseconds.
Gets the popup control used for displaying auto-hide windows.
public AutoHidePopup AutoHidePopup { get; }
An AutoHidePopup instance that manages the display of auto-hidden windows.
The auto-hide popup is displayed when the user hovers over an auto-hide tab, showing the content of the associated docking window temporarily.
Gets the RadDockCommandManager registered with this RadDock instance.
[Browsable(false)]
public RadDockCommandManager CommandManager { get; }
Overrides the content rectangle to add any visible auto-hide tabstrips to the calculations.
[Browsable(false)]
public override Rectangle ContentRectangle { get; }
Overrides:
Gets or sets the template, which defines the appearance of the guides displayed upon drag-and-drop operation.
[Browsable(false)]
public IDockingGuidesTemplate DockingGuidesTemplate { get; set; }
Gets a collection with all the currently attached DockWindow instances.
[Browsable(false)]
public DockWindowCollection DockWindows { get; }
Gets the DocumentManager instance that manages all the DockWindow instances which are parented MainDocumentContainer. For a Document is considered either a DocumentWindow instance or a ToolWindow, which current DockState is TabbedDocument.
public DocumentManager DocumentManager { get; }
Gets or sets the alignment of the TabStripElement in all DocumentTabStrip instances.
public TabStripAlignment DocumentTabsAlignment { get; set; }
Gets or sets the text orientation of the TabStripElement in all ToolTabStrip instances.
public TabStripTextOrientation DocumentTabsTextOrientation { get; set; }
Determines whether the TabStripElement in DocumentTabStrip instances is visible.
public bool DocumentTabsVisible { get; set; }
Gets or sets the allowed dock states for a committing drag-and-drop operation.
public AllowedDockState DragDropAllowedDockStates { get; set; }
Gets or sets the mode used by the DragDropService when a drag-and-drop request is made.
public DragDropMode DragDropMode { get; set; }
Determines whether all floating windows' will snap to their edges.
[Browsable(true)]
public bool EnableFloatingWindowSnapping { get; set; }
Determines whether all floating windows' frames within the framework will be themed using Telerik's TPF or will be let with their system appearance.
public bool EnableFloatingWindowTheming { get; set; }
Gets a collection of mappings between GUIDs and window names used during serialization and deserialization.
[Browsable(false)]
public GuidToNameMappingCollection GuidToNameMappings { get; }
This collection maintains the associations between window GUIDs and their names, which is critical for correctly restoring windows during deserialization.
The GUID-to-name mappings ensure that windows can be identified consistently across serialization operations, even if window names change. This is particularly important when loading layouts in applications where window instances may be recreated with different names but should still be recognized as the same logical windows.
Gets a value indicating whether a drag-and-drop operation is currently in progress.
[Browsable(false)]
public bool IsDragging { get; }
This property checks the state of the DragDropService to determine if a window or tab is currently being dragged by the user. This can be useful for controlling UI behavior during drag operations or for preventing certain actions while dragging is in progress.
Determines whether the RadDock is currently in a transaction (internal operation).
[Browsable(false)]
public bool IsInTransactionBlock { get; }
Gets or sets the Type to be used when a new RadSplitContainer instance is internally created and a layout strategy is initialized for it. Allows plugging of completely custom layout behavior.
[Browsable(false)]
public Type LayoutStrategyType { get; set; }
Determines whether the main document container is visible.
public bool MainDocumentContainerVisible { get; set; }
Gets an array with all the standard Forms added as TabbedDocument to this RadDock instance.
[Browsable(false)]
public Form[] MdiChildren { get; }
Gets or sets a value indicating dock type of MDI child host windows added to RadDock.
public DockType MdiChildrenDockType { get; set; }
Gets the object which controls the appearance of the QuickNavigator control.
public QuickNavigatorSettings QuickNavigatorSettings { get; }
Gets an instance of DockAutoHideSerializationContainer that contains information about auto-hidden windows which have been set up through designer or xml file. This nethod is no intended for use directly from your code.
[Browsable(false)]
public DockAutoHideSerializationContainer SerializableAutoHideContainer { get; }
Gets an instance of FloatingWindowList that contains information about floating windows which have been set up through designer or xml file. This nethod is no intended for use directly from your code.
[Browsable(false)]
public FloatingWindowList SerializableFloatingWindows { get; }
Determines whether DocumentTabStrip instances will display a Close Button next to each item.
public bool ShowDocumentCloseButton { get; set; }
Determines whether DocumentTabStrip instances will display a Pin Button next to each item.
public bool ShowDocumentPinButton { get; set; }
Determines whether ToolTabStrip instances will display Close Button next to each item.
public bool ShowToolCloseButton { get; set; }
Gets or sets a value indicating whether the RadDock control behavior and layout apply only to primary screen.
[Browsable(true)]
public bool SingleScreen { get; set; }
Gets the collection of split panels contained in this RadDock control.
[Browsable(false)]
public SplitPanelCollection SplitPanels { get; }
A SplitPanelCollection containing the split panels.
This property is hidden from the designer and should not be used directly. The RadDock control manages its panels internally.
Gets or sets the width of a single splitter on the container. Specify zero to prevent displaying any splitters at all.
public override int SplitterWidth { get; set; }
Overrides:
Gets the layout panel that contains the tab strips for the docking windows.
[Browsable(false)]
public DockLayoutPanel TabStripsLayout { get; }
A DockLayoutPanel that manages the layout of tab strips in the docking framework.
Gets or sets the theme class name used for applying visual styles to this control.
[Browsable(false)]
public override string ThemeClassName { get; set; }
Overrides:
The theme class name is used by the theming engine to identify which visual styles should be applied to this control. For RadDock, this property always returns the full name of the RadDock class, ensuring consistent styling across all instances.
This property is overridden to provide a fixed value and should not be modified directly.
Gets DockWindow instance with the corresponding Name.
public DockWindow this[string dockWindowName] { get; }
DockWindow instance with matching Name. Null (Nothing in VB.NET) otherwise.
Gets or sets the alignment of the TabStripElement in all ToolTabStrip instances.
public TabStripAlignment ToolTabsAlignment { get; set; }
Gets or sets the text orientation of the TabStripElement in all ToolTabStrip instances.
public TabStripTextOrientation ToolTabsTextOrientation { get; set; }
Determines whether the TabStripElement in ToolTabStrip instances is visible.
public bool ToolTabsVisible { get; set; }
Gets or sets the insert order to be used when adding dock windows to a ToolTabStrip.
public DockWindowInsertOrder ToolWindowInsertOrder { get; set; }
Gets the serialization info for RadDock used by Save/Load loyout methods to persist grid settings to/from XML. By default, or when set to null the ComponentXmlSerializationInfo provided by GetDefaultXmlSerializationInfo() will be used.
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Methods
Activates the MDI child of a form.
Activates the specified window and gives it the keyboard focus.
protected virtual bool ActivateWindow(DockWindow window, bool forceNotify)
True to force ActiveWindowChanging and ActiveWindowChanged notifications, false otherwise. Sometimes a transaction may change the current active window several times and the method needs to know when to raise the notifications.
Returns:Activates the specified DockWindow and gives it the keyboard focus.
public bool ActivateWindow(DockWindow window)
The DockWindow to activate. If null, no window will be activated.
Returns:True if the window was successfully activated and has focus; otherwise, false.
This method activates the specified window by:
- Making it the active window in the RadDock control
- Ensuring it's visible (sliding out if auto-hidden)
- Giving it keyboard focus
- Updating its visual state to appear active
- Raising appropriate ActiveWindowChanging and ActiveWindowChanged events
This method is equivalent to calling ActivateWindow(window, false).
Adds the the specified DockWindow instance at the specified dock position, aligned with the main document tabstrip.
public void AddDocument(DockWindow dockWindow, DockPosition position)
The dock window.
positionDockPositionThe desired dock position.
Adds the the specified DockWindow instance to the specified DocumentTabStrip instance.
public void AddDocument(DockWindow dockWindow, DockWindow target, DockPosition position)
The dock window.
targetDockWindowThe target of the dock opeation.
positionDockPositionThe desired dock position.
Adds the specified DockWindow instance to a new DocumentTabStrip instance.
public void AddDocument(DockWindow dockWindow, DocumentTabStrip tabStrip, DockPosition position)
The dock window.
tabStripDocumentTabStripThe DocumentTabStrip, which is the target of the operation.
positionDockPositionThe position.
Adds the specified DockWindow instance to the main document tab strip.
Adds a collection of DockWindows to a new DocumentTabStrip instance.
public void AddDocuments(DockWindow[] dockWindows, DocumentTabStrip tabStrip, DockPosition position)
The dock windows.
tabStripDocumentTabStripThe DocumentTabStrip, which is the target of the operation.
positionDockPositionThe position.
Makes the specified DockWindow auto-hidden along an edge of the docking layout.
public void AutoHideWindow(DockWindow window)
The DockWindow instance to auto-hide.
This method changes the dock state of the window to auto-hide, making it collapse to a tab along an edge of the docking layout. When auto-hidden, the window will slide out when the user hovers over or clicks its tab.
If the window is part of a tab strip, the entire tab strip will be auto-hidden. The auto-hide position (Left, Right, Top, Bottom) is determined based on the window's current position in the layout.
Makes the specified collection of DockWindow instances auto-hidden at a specific edge.
public void AutoHideWindows(IEnumerable<DockWindow> windows, AutoHidePosition position)
The collection of DockWindow instances to auto-hide.
positionAutoHidePositionThe edge position (Left, Right, Top, Bottom) at which the windows should be auto-hidden.
This method changes the dock state of all specified windows to auto-hide, making them collapse to tabs along the specified edge of the docking layout. When auto-hidden, the windows will slide out when the user hovers over or clicks their tabs.
All windows specified will be grouped together in the auto-hide area, with each window represented by a tab.
Signals the object that initialization is beginning.
public override void BeginInit()
Overrides:
This method suspends certain operations like layout updates and event raising during the initialization phase to improve performance and prevent errors from incomplete state.
Opens a transaction (batch) operation. This is used by the framework to indicate some lengthy operations, during which no updates should be performed.
public void BeginTransactionBlock()
Opens a transaction (batch) operation. This is used by the framework to indicate some lengthy operations, during which no updates should be performed.
Begins an update operation. Internally used by the transaction mechanism.
public void BeginUpdate()
Determines whether the specified window's DockState value can be changed to the specified new one.
protected virtual bool CanChangeWindowState(DockWindow window, DockState state, bool raiseChanging)
The window, which should be examined.
stateDockStateThe new target state.
raiseChangingboolTrue to raise DockStateChanging notification, false otherwise.
Returns:True if the state can be changed, false otherwise.
Determines whether the provided dock state may be applied to the specified DockWindow.
public bool CanChangeWindowState(DockWindow window, DockState state)
Performs a clean-up pass which removes all unnecessary internally created split panels and/or collapses or disposes them.
public void CleanUp()
Calls the Close method for all currently registered windows, using each window's CloseAction.
public bool CloseAllWindows()
[true] if all windows were successfully closed, [false] otherwise
Closes the popup of the currently opened auto-hide window.
public void CloseAutoHidePopup()
Removes or hides the specified window based on its CloseAction property.
public void CloseWindow(DockWindow window)
The DockWindow instance to close.
This method closes the specified window according to its CloseAction property:
- CloseAction.Close: Removes the window from the layout without disposing it
- CloseAction.CloseAndDispose: Removes the window and disposes it
- CloseAction.Hide: Hides the window but keeps it registered with the docking manager
If the window is already hidden (DockState.Hidden) and its CloseAction is Hide, this method does nothing.
Removes or hides the specified collection of windows based on their CloseAction properties.
public void CloseWindows(IEnumerable<DockWindow> windows)
The collection of DockWindow instances to close.
This method closes each window in the collection according to its CloseAction property:
- CloseAction.Close: Removes the window from the layout without disposing it
- CloseAction.CloseAndDispose: Removes the window and disposes it
- CloseAction.Hide: Hides the window but keeps it registered with the docking manager
The operation is performed as a single transaction, ensuring consistent behavior and proper events. Before closing each window, a DockWindowClosing event is raised, which can be handled to cancel the operation for specific windows.
Commits the specified transaction.
protected virtual void CommitTransaction(RadDockTransaction transaction)
Determines whether the specified DockWindow is registered with this RadDock instances.
protected override void CreateChildItems(RadElement parent)
Overrides:
Creates and returns the default DockTabStrip for a given DockType.
public DockTabStrip CreateDefaultTabStrip(DockType type)
The DockType that determines what kind of tab strip to create. DockType.Document creates a DocumentTabStrip, while any other value creates a ToolTabStrip.
Returns:A new instance of DockTabStrip appropriate for the specified dock type, with default properties applied based on the dock type.
This method creates either a DocumentTabStrip or ToolTabStrip based on the specified type parameter. The created tab strip is properly initialized with DPI scaling and other settings but is not automatically added to the dock layout - you need to add it manually to the appropriate container.
Creates new SplitContainerLayoutStrategy instance. Allows inheritors to provide custom layout strategy implementation.
protected virtual SplitContainerLayoutStrategy CreateLayoutStrategy()
A new instance of SplitContainerLayoutStrategy that will be used for layout calculations.
This method creates a layout strategy based on the layoutStrategyType field. If instantiation fails or layoutStrategyType is null, it creates a default SplitContainerLayoutStrategy instance. The layout strategy is responsible for calculating the size and position of panels within split containers.
Creates the core XmlWritterSettings to be used by the serialization manager.
Visualizes the QuickNavigator control allowing for active tool windows and documents browsing.
public QuickNavigator DisplayQuickNavigator()
The QuickNavigator instance that is currently displayed. May return null if operation was unsuccessful.
Displays the specified window if it was previously hidden, restoring it to its previous dock state.
public void DisplayWindow(DockWindow window)
The DockWindow instance to display.
This method restores a hidden window to its previous dock state. If the window was not previously hidden or is not registered with this RadDock instance, this method has no effect.
The window will be displayed in the same location it was in before being hidden, whether that was docked, floating, auto-hidden, or as a tabbed document.
Displays the provided collection of dock windows if they were previously hidden and are registered with this RadDock instance.
public void DisplayWindows(IEnumerable<DockWindow> windows)
The collection of DockWindow instances to display.
This method restores hidden windows to their previous dock states. Only windows that meet all of the following criteria are affected:
- The window is registered with this RadDock instance
- The window is currently hidden (DockState.Hidden)
- The window has a valid previous dock state to restore to
Each window will be displayed in the same location it was in before being hidden, whether that was docked, floating, auto-hidden, or as a tabbed document.
Releases the unmanaged resources used by the RadDock and optionally releases the managed resources.
protected override void Dispose(bool disposing)
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides:
This method cleans up all resources associated with the docking framework, including command managers, document managers, MDI controllers, and floating windows.
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockPosition position, DockType dockType)
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockPosition position)
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockTabStrip dockAnchor, DockPosition position, DockType dockType)
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockTabStrip dockAnchor, DockPosition position)
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockWindow target, DockPosition position, DockType dockType)
Registers the specified control as part of the docking framework.
public HostWindow DockControl(Control control, DockWindow target, DockPosition position)
Registers the specified DockWindow instance and docks it at the desired position.
public void DockWindow(DockWindow dockWindow, DockPosition position)
The window to dock.
positionDockPositionThe position where the window should be docked (Top, Bottom, Left, Right, Fill).
This method registers the window with the docking manager and positions it according to the specified dock position. The window will be docked relative to the main container.
Registers the specified DockWindow instance and docks it at the desired position, using the provided target window as an anchor.
public void DockWindow(DockWindow dockWindow, DockWindow target, DockPosition position)
The window to dock.
targetDockWindowThe target window to use as an anchor for the docking operation. If null, the main container is used.
positionDockPositionThe position relative to the target where the window should be docked (Top, Bottom, Left, Right, Fill).
This method registers the window with the docking manager and positions it according to the specified dock position, relative to the target window. If the target is null, the main container is used as the reference point.
Registers the specified DockWindow instance and docks it at the desired position, using the provided SplitPanel as an anchor.
public void DockWindow(DockWindow window, SplitPanel dockAnchor, DockPosition position)
Any split panel instance that resides
positionDockPositionSignals the object that initialization is complete.
public override void EndInit()
Overrides:
This method is called at the end of initialization and ensures that all components of the RadDock framework are properly initialized and registered, including floating windows, auto-hide windows, and docked windows.
Ends the current transaction block and commits all pending transactions.
public void EndTransactionBlock()
This method decrements the transaction block counter. When the counter reaches zero, all pending transactions are executed, and normal layout operations are resumed. Each call to EndTransactionBlock should correspond to a previous call to BeginTransactionBlock.
Ends a BeginUpdate block.
public void EndUpdate()
Ends a BeginUpdate block and optionally performs layout update.
public void EndUpdate(bool update)
Specifies whether to perform layout operations after ending the update block. When true, layout operations are performed. When false, layout remains suspended.
Use this method to end an update operation that was started with BeginUpdate. The update parameter allows control over whether layout is immediately performed or remains suspended.
Adds a transaction operation to the current transaction block.
public void EnqueueTransaction(RadDockTransaction transaction)
The transaction to add to the current block. Must not be null.
Exceptions:Thrown when the transaction parameter is null.
Thrown when there is no active transaction block.
This method adds a dock operation to the current transaction. Transactions are executed as a batch when the transaction block is closed. A transaction block must be opened with BeginTransactionBlock before this method can be called.
Enumerates all currently alive T instances available within the framework.
public IEnumerable<T> EnumFrameworkControls<T>() where T : Control
IEnumerable<T>
Makes the specified tool tab strip floating (detached in its own window).
public void FloatToolTabStrip(ToolTabStrip strip, Rectangle bounds)
The ToolTabStrip to make floating.
boundsRectangleThe desired floating bounds. Pass Rectangle.Empty to set the default bounds based on the strip's preferred size.
This method detaches the entire tool tab strip, including all contained windows, from its current position in the docking layout and displays it in a separate floating window with the specified bounds. The tab structure is preserved in the floating window - all windows that were in the tab strip remain grouped together.
Makes the specified window floating (detached in its own window), using the provided bounds.
public void FloatWindow(DockWindow window, Rectangle bounds)
The DockWindow instance to make floating.
boundsRectangleThe desired floating bounds. Pass Rectangle.Empty to set the default bounds based on the window's preferred size.
This method detaches the window from its current position in the docking layout and displays it in a separate floating window with the specified bounds. The DockType of the container in the floating window is automatically determined based on whether the window is a DocumentWindow or not.
Makes the specified window floating (detached in its own window).
public void FloatWindow(DockWindow window)
The DockWindow instance to make floating.
This method detaches the window from its current position in the docking layout and displays it in a separate floating window. It uses default bounds for the new floating window. To specify the bounds of the floating window, use the overload that accepts a Rectangle parameter.
Makes the specified windows floating (detached in a single window), using the provided bounds and container type.
public void FloatWindows(IEnumerable<DockWindow> windows, Rectangle bounds, DockType containerType)
The collection of DockWindow instances to make floating together.
boundsRectangleThe desired floating bounds. Pass Rectangle.Empty to set the default bounds based on the windows' preferred sizes.
containerTypeDockTypeThe type of the container inside the floating form - DockType.ToolWindow or DockType.Document.
This method detaches all the specified windows from their current positions in the docking layout and displays them together in a single floating window with the specified bounds. All windows will be arranged in a tab strip of the specified type within the floating window. The container type determines the appearance and behavior of the tab strip in the floating window.
Makes the specified collection of windows floating (detached in a single window), using the provided bounds.
public void FloatWindows(IEnumerable<DockWindow> windows, Rectangle bounds)
The collection of DockWindow instances to make floating together.
boundsRectangleThe desired floating bounds. Pass Rectangle.Empty to set the default bounds based on the windows' preferred sizes.
This method detaches all the specified windows from their current positions in the docking layout and displays them together in a single floating window with the specified bounds. All windows will be arranged in a tab strip within the floating window. This overload uses DockType.ToolWindow as the container type. For document windows, use the overload that accepts a DockType parameter.
Commits all pending transactions without exitting the transaction block.
public void FlushTransactions()
Gets the tab strip item associated with an auto-hidden dock window.
public TabStripItem GetAutoHideTab(DockWindow dockWindow)
The dock window for which to find the auto-hide tab.
Returns:The TabStripItem representing the auto-hide tab for the specified window, or null if the window is not in auto-hide mode or doesn't have an associated tab.
Auto-hide tabs are displayed along the edges of the docking container and allow users to temporarily show windows that are in auto-hide mode.
Gets the auto hide tab strip.
public RadPageViewStripElement GetAutoHideTabStrip(AutoHidePosition position)
The edge position of the auto-hide strip to retrieve.
Returns:A RadPageViewStripElement representing the tab strip at the specified position.
The tab strip contains the tabs that represent auto-hidden windows. When the user hovers over one of these tabs, the corresponding window is temporarily displayed.
Gets the default DocumentTabStrip instance, used to add documents without explicitly specified dock target.
public DocumentTabStrip GetDefaultDocumentTabStrip(bool createNew)
True to create a new DocumentTabStrip instance and add it to the document container.
Returns:Gets the default serialization information for RadDock used by Save/Load layout methods to persist docking settings to/from XML.
public virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
A ComponentXmlSerializationInfo object containing the default serialization settings for RadDock.
You can use the serialization information to customize which properties of RadDock and related objects are included in or excluded from XML serialization. This allows you to control exactly what aspects of the docking layout are persisted.
To customize serialization, you can:
- Override this method in a derived class to return modified serialization information
- Modify the XmlSerializationInfo property directly
Common customizations include:
- Excluding specific properties that shouldn't be persisted
- Adding custom properties that should be persisted
- Changing serialization behavior for certain object types
Get the host window for Control instance docked with DockControl method or for MDI children Form object
public HostWindow GetHostWindow(Control control)
found HostWindow instance or null
Gets the next document tab strip, regarding the specified DockWindow. The window should be in TabbedDocument state for the method to work.
public DocumentTabStrip GetNextDocumentStrip(DockWindow window)
Gets the previous document tab strip, regarding the specified DockWindow. The window should be in TabbedDocument state for the method to work.
public DocumentTabStrip GetPreviousDocumentStrip(DockWindow window)
Retrieves the currently registered service by the specified type.
public T GetService<T>() where T : RadDockService
T
The registered service of type T, or null if no such service is registered.
This method searches all registered services for one that is of the specified type T. It returns the first matching service found, or null if no service of type T is registered. This method is useful when you know what kind of service you need but don't know its key.
Retrieves the currently registered service by the provided key.
protected T GetService<T>(int key) where T : RadDockService
The key that identifies the service, typically a value from ServiceConstants.
Returns:T
The registered service of type T associated with the specified key, or null if no such service is registered.
This method retrieves a service using its key. All predefined service keys can be found in the ServiceConstants class. It returns the service cast to type T, or null if either no service is registered with the key or the registered service is not of type T.
public override SplitterElement GetSplitterElementAtPoint(Point clientPoint)
Overrides:
Gets DockWindow instance with the corresponding Name by the specified type.
public T GetWindow<T>(string dockWindowName) where T : DockWindow
T
DockWindow instance with matching Name. Null (Nothing in VB.NET) otherwise.
Gets the windows by the specified types.
public IEnumerable<DockWindow> GetWindows(params Type[] types)
The types of the windows to get.
Returns:IEnumerable<DockWindow>
A collection of DockWindow instances matching the specified types. If no types are specified, returns all windows.
This method filters windows based on their type. It can be used to retrieve specific window types, such as tool windows or document windows, by providing the corresponding type parameters.
Gets the windows by the specified type.
public IEnumerable<T> GetWindows<T>() where T : DockWindow
IEnumerable<T>
Loads the docking layout configuration from an XML stream.
public void LoadFromXml(Stream stream, bool clearDocking = false)
The stream containing the XML layout data. The stream must be readable and its position will be reset to the beginning.
clearDockingboolWhen set to true, removes all existing dock windows using the CloseAndDispose action before loading the new layout.
This method automatically detects whether the XML in the stream was created with the legacy DockingManager or with the current RadDock, and adapts its loading strategy accordingly. This enables backward compatibility with layouts saved by older versions.
The XML stream should contain information about window positions, sizes, dock states, and relationships between windows. Windows that need to be restored must already be registered with this RadDock instance or they will be ignored during loading.
This overload is useful when the layout is stored in memory or in a database rather than in a file. To save the current layout to a stream, use the SaveToXml(Stream) method.
Loads the docking layout configuration from an XML file.
public void LoadFromXml(string fileName, bool clearDocking = false)
The path to the XML file containing the saved layout.
clearDockingboolWhen set to true, removes all existing dock windows using the CloseAndDispose action before loading the new layout.
This method automatically detects whether the XML file was created with the legacy DockingManager or with the current RadDock, and adapts its loading strategy accordingly. This enables backward compatibility with layouts saved by older versions.
The XML file contains information about window positions, sizes, dock states, and relationships between windows. Windows that need to be restored must already be registered with this RadDock instance or they will be ignored during loading.
To save the current layout to an XML file, use the SaveToXml method and any of its overloads.
Loads the docking layout configuration from a TextReader. Note that this is a new method and does not support loading xml that was written using DockingManager.
public void LoadFromXml(TextReader textReader, bool clearDocking = false)
The text reader.
clearDockingboolif set to true removes the existing dock windows using the CloseAndDispose action.
Overrwrite this method to change the loading of docking layout configuration.
protected virtual void LoadFromXmlCore(XmlReader reader, bool oldXmlFormat, bool clearDocking = false)
The XmlReader instance that will be used to load the layoiut configuration.
oldXmlFormatboolif set to true the layout configuration is in the old DockingManager format.
if set to true removes the existing dock windows using the CloseAndDispose action.
Move DockWindow to next document tab strip if exist when DockWindow is in document mode
public bool MoveToNextDocumentTabStrip(DockWindow dockWindow)
Move DockWindow to previuos document tab strip if exist when DockWindow is in document mode
public bool MoveToPreviousDocumentTabStrip(DockWindow dockWindow)
Raises the ActiveWindowChanged event.
protected virtual void OnActiveWindowChanged(DockWindowEventArgs e)
Raises the ActiveWindowChanging event.
protected virtual void OnActiveWindowChanging(DockWindowCancelEventArgs e)
An Auto-hide button click notification, received from a registered ToolTabStrip.
Raises the AutoHideWindowDisplayed event.
protected virtual void OnAutoHideWindowDisplayed(DockWindowEventArgs e)
Raises the AutoHideWindowDisplaying event.
protected virtual void OnAutoHideWindowDisplaying(AutoHideWindowDisplayingEventArgs e)
Raises the AutoHideWindowHidden event.
protected virtual void OnAutoHideWindowHidden(DockWindowEventArgs e)
Raises the AutoHideWindowHiding event.
protected virtual void OnAutoHideWindowHiding(DockWindowCancelEventArgs e)
Called when the BackgroundImage property changes.
protected override void OnBackgroundImageChanged(EventArgs e)
An EventArgs that contains the event data.
Overrides:
This override updates the visibility settings of various elements based on whether a background image is present.
protected override void OnControlTreeChanged(ControlTreeChangedEventArgs args)
Overrides:
Raises the DockStateChanged event.
Raises the DockStateChanging event.
protected virtual void OnDockStateChanging(DockStateChangingEventArgs e)
Recieves a notification for a change state request, made from the window's associated context menu.
protected virtual void OnDockStateContextMenuClicked(DockWindow window, DockState newState)
Raises the DockWindowAdded event.
Raises the DockWindowClosed event.
Raises the DockWindowClosing event.
protected virtual void OnDockWindowClosing(DockWindowCancelEventArgs e)
The manager gets notified for a change in the specified DockWindow instance Name property.
protected virtual void OnDockWindowNameChanged(DockWindow dockWindow, string oldName)
The DockWindow which name has changed.
oldNamestringThe window's previous name.
Raises the DockWindowRemoved event.
protected virtual void OnDockWindowRemoved(DockWindowEventArgs e)
Raises the DockWindowSerializing event.
protected virtual bool OnDockWindowSerializing(DockWindow dockWindow)
[true] if canceled, [false] otherwise.
Called when the control's Enabled property changes. Synchronizes the command manager's enabled state.
protected override void OnEnabledChanged(EventArgs e)
An EventArgs that contains the event data.
Overrides:
This override ensures that the command manager's enabled state is synchronized with the control's Enabled property, preventing command processing when the control is disabled.
Raises the FloatingWindowCreated event.
protected virtual void OnFloatingWindowCreated(FloatingWindowEventArgs e)
Called when the control's handle is destroyed. Disables the command manager to prevent stray commands.
protected override void OnHandleDestroyed(EventArgs e)
An EventArgs that contains the event data.
Overrides:
This override ensures that the command manager is disabled when the control's handle is destroyed, preventing any command processing after the handle is gone but the control is still alive.
Called when control's creation is complete.
Raises the LoadedFromXml event.
protected virtual void OnLoadedFromXml()
Called when a mouse button is pressed over the control.
protected override void OnMouseDown(MouseEventArgs e)
The mouse event arguments.
Overrides:
Called when the mouse pointer moves over the control.
protected override void OnMouseMove(MouseEventArgs e)
The mouse event arguments.
Overrides:
Raises the ParentChanged event.
protected override void OnParentChanged(EventArgs e)
An EventArgs that contains the event data.
Overrides:
This method updates the internal parent form reference and reconnects event handlers when the parent of the RadDock control changes. It's essential for proper operation of floating windows and auto-hide functionality.
Raises the QuickNavigatorSnapshotNeeded event.
protected virtual void OnQuickNavigatorSnapshotNeeded(DockWindowSnapshotEventArgs e)
Raises the SavedToXml event.
protected virtual void OnSavedToXml()
protected virtual void OnSelectedTabChanged(SelectedTabChangedEventArgs e)
protected virtual void OnSelectedTabChanging(SelectedTabChangingEventArgs e)
protected virtual void OnTabStripItemDoubleClick(TabStripItem item, DockTabStrip strip)
Delegates the ThemeChanged event to all owned controls and elements.
protected override void OnThemeChanged()
Overrides:
Receives a notification from a tooltabstrip that the mouse was clicked inside its area. The default implementation will try to restore the state of the associated windows.
protected virtual void OnToolTabStripDoubleClick(ToolTabStrip strip, Point click)
Raises the TransactionBlockEnded event.
Raises the TransactionBlockStarted event.
Raises the TransactionCommitted event.
protected virtual void OnTransactionCommitted(RadDockTransactionEventArgs e)
Raises the TransactionCommitting event.
protected virtual void OnTransactionCommitting(RadDockTransactionCancelEventArgs e)
Performs the core update logic after an EndUpdate call.
protected virtual void PerformUpdate()
Allows inheritors to provide additional post-commit processing of a transaction.
protected virtual void PostCommitTransaction(RadDockTransaction transaction)
Allows inheritors to provide additional pre-commit processing of a transaction.
protected virtual void PreCommitTransaction(RadDockTransaction transaction)
Processes a focus request from the specified element.
protected override bool ProcessFocusRequested(RadElement element)
The element that requested the focus.
Returns:True if focus is approved, false otherwise.
Overrides:
Registers the specified service with this RadDock instance.
public void RegisterService(int key, RadDockService service)
The key that identifies the service, typically a value from ServiceConstants.
serviceRadDockServiceThe RadDockService instance to register.
This method registers a service that provides additional functionality to the RadDock control. If a service with the same key already exists, it will be detached and replaced with the new service. Services are used to extend RadDock functionality without modifying its core code. Common services include RedockService for state persistence and CommandService for command routing.
Removes all DocumentWindows, without disposing it.
public void RemoveAllDocumentWindows()
Removes all DocumentWindows, using the specified close action.
public void RemoveAllDocumentWindows(DockWindowCloseAction closeAction)
The action to be taken when closing a window.
Removes all ToolWindows with the specified DockState, using the specified close action.
public void RemoveAllToolWindows(DockWindowCloseAction closeAction = DockWindowCloseAction.Close, AllowedDockState allowedDockState = AllowedDockState.Docked | AllowedDockState.AutoHide)
The action to be taken when closing a window.
allowedDockStateAllowedDockStateSpecifies the DockState of the ToolWindows that will be removed. The enumeration flags can be combined.
Removes all DockWindows from the docking manager, without disposing them.
public void RemoveAllWindows()
This method removes all windows from the docking manager using the DockWindowCloseAction.Close action. The windows are removed from the docking layout but are not disposed, so they can be reused later. To control the close action, use the overload that accepts a DockWindowCloseAction parameter.
Removes all DockWindows from the docking manager, using the specified close action.
public void RemoveAllWindows(DockWindowCloseAction closeAction)
The action to be taken when closing each window. This can be Close (remove without disposing), CloseAndDispose (remove and dispose), or Hide (hide without removing).
This method removes all windows from the docking manager using the specified close action. It begins a transaction block before removing windows and ends it after all windows are removed.
Removes the specified window, using the specified DockWindowCloseAction.
public void RemoveWindow(DockWindow window, DockWindowCloseAction closeAction)
The desired action to be taken.
Removes the specified window, without disposing it, from the dock manager.
Saves the current docking layout configuration in XML format to the specified stream.
public void SaveToXml(Stream stream)
The stream where the layout should be written. The stream must be writable.
This method serializes the current state of all dock windows to the provided stream. This overload is useful when you need to save the layout to memory, a database, or another destination other than a file.
The serialized data includes:
- Window positions and sizes
- Dock states (docked, floating, auto-hidden, etc.)
- Tab groups and arrangements
- Window relationships and hierarchy
To restore a layout from a stream, use the LoadFromXml(Stream, bool) method.
Saves the current docking layout configuration in XML format to the specified file.
public void SaveToXml(string fileName)
The path to the file where the layout should be saved. If the file exists, it will be overwritten.
This method serializes the current state of all dock windows, including their positions, sizes, dock states, and relationships. The resulting XML file can later be used to restore the layout using the LoadFromXml(string, bool) method.
The serialized data includes:
- Window positions and sizes
- Dock states (docked, floating, auto-hidden, etc.)
- Tab groups and arrangements
- Window relationships and hierarchy
Note that only the structural information is saved, not the actual content of the windows. When restoring a layout, the windows must already be registered with the RadDock instance.
Saves the current docking layout configuration in XML format using the specified TextWriter.
public void SaveToXml(TextWriter textWriter)
The TextWriter instance to which the XML should be written.
This method serializes the current state of all dock windows using the provided TextWriter. This overload is useful when you need fine-grained control over the text output process, such as when writing to a custom text destination or applying additional text processing.
The serialized data includes the same information as the other SaveToXml methods:
- Window positions and sizes
- Dock states (docked, floating, auto-hidden, etc.)
- Tab groups and arrangements
- Window relationships and hierarchy
The XML is formatted with proper indentation for readability.
Performs the core XML serialization logic for saving the docking layout.
protected virtual void SaveToXmlCore(XmlWriter writer)
The XmlWriter to which the XML should be written.
This method contains the actual implementation of the XML serialization process. It sorts floating windows by Z-order, creates a serializer with the appropriate settings, and writes the RadDock object structure to XML.
This method can be overridden in derived classes to customize the serialization process while still using the basic SaveToXml methods.
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Overrides:
Applies the desired DockState to the specified DockWindow, either by restoring a previously saved state or performing the default action.
public void SetWindowState(DockWindow window, DockState state)
The DockWindow instance to change state for.
stateDockStateThe target dock state to apply (Docked, TabbedDocument, AutoHide, Floating, Hidden).
This method changes the dock state of the window to the specified state. If the window is already in the requested state, this method has no effect.
If a previously saved layout state exists for this window in the requested dock state (through the RedockService), that state will be restored, preserving the window's previous position and size in that state. Otherwise, the default action will be performed:
- DockState.Docked: Window will be docked to the left side
- DockState.TabbedDocument: Window will be added as a document
- DockState.AutoHide: Window will be auto-hidden on the left side
- DockState.Floating: Window will be floated
- DockState.Hidden: Window will be hidden
Displays the auto-hide popup for the specified host window.
public void ShowAutoHidePopup(HostWindow window)
The host window to display in the auto-hide popup.
This method displays the auto-hide popup for a host window as if its tab was clicked, causing the window to slide out from its auto-hide position.
Displays the auto-hide popup for the specified tool window.
public void ShowAutoHidePopup(ToolWindow window)
The tool window to display in the auto-hide popup.
This method displays the auto-hide popup for a tool window as if its tab was clicked, causing the window to slide out from its auto-hide position.
Updates the visibility settings of split panel elements based on whether a background image is set.
protected void UpdateBackgroundSettings()
When a background image is set, certain panel elements are hidden to allow the background image to show through. When no background image is set, the elements' visibility is reset to their default values.
Events
Notifies for an actual change of the ActiveWindow property.
public event DockWindowEventHandler ActiveWindowChanged
Notifies for an upcomming change of the ActiveWindow property. Cancelable.
public event DockWindowCancelEventHandler ActiveWindowChanging
Notifies that an auto-hidden window is about to be displayed. Cancelable.
public event DockWindowEventHandler AutoHideWindowDisplayed
Notifies that an auto-hidden window is about to be displayed. Cancelable.
public event AutoHideWindowDisplayingEventHandler AutoHideWindowDisplaying
Notifies that a window which DockState is AutoHide has been hidden.
public event DockWindowEventHandler AutoHideWindowHidden
Notifies that a window with AutoHide DockState is hiding.
public event DockWindowCancelEventHandler AutoHideWindowHiding
Notifies for a change in the DockState of the associated window.
public event DockWindowEventHandler DockStateChanged
Notifies for an upcomming change in the DockState of the associated window. Cancelable.
public event DockStateChangingEventHandler DockStateChanging
Raised whenever a new DockTabStrip instance is needed internally by the framework. Allows for providing custom ToolTabStrip and DocumentTabStrip implementations.
public event DockTabStripNeededEventHandler DockTabStripNeeded
Notifies for a new DockWindow registered with this RadDock instance.
public event DockWindowEventHandler DockWindowAdded
Raised after a DockWindow has been closed.
public event DockWindowEventHandler DockWindowClosed
Raised before a DockWindow.Close method is called.
public event DockWindowCancelEventHandler DockWindowClosing
Notifies for a DockWindow removed from this RadDock instance. This event will not be raised for hidden windows.
public event DockWindowEventHandler DockWindowRemoved
Fired when a dock window is being serialized. Allows excluding some windows from serialization.
public event EventHandler<DockWindowCancelEventArgs> DockWindowSerializing
Notifies that a FloatingWindow instance is internally created by the framework. Allows listeners to examine and optionally change the window itself.
public event FloatingWindowEventHandler FloatingWindowCreated
Notifies that manager's state has been loaded from an external XML source.
public event EventHandler LoadedFromXml
Fires after RadPageViewElement is created.
public event PageViewInstanceCreatedEventHandler PageViewInstanceCreated
Raised when the QuickNavigator is displayed and a preview snapshot for the currently selected window is needed.
public event DockWindowSnapshotEventHandler QuickNavigatorSnapshotNeeded
Notifies that manager's state has been saved to an external XML source.
public event EventHandler SavedToXml
Occurs when selected tab changed in currently manipulated DockTabStrip.
public event SelectedTabChangedEventHandler SelectedTabChanged
Occurs when selected tab changing in currently manipulated DockTabStrip.
public event SelectedTabChangingEventHandler SelectedTabChanging
Raised whenever a new RadSplitContainer instance is needed internally by the framework. Allows for providing custom RadSplitContainer implementation.
public event SplitContainerNeededEventHandler SplitContainerNeeded
Notifies for a successful EndTransactionBlock operation, when all transactions are committed, the DockTree is cleaned, and updates are resumed.
public event EventHandler TransactionBlockEnded
Notifies for a successful BeginTransactionBlock operation.
public event EventHandler TransactionBlockStarted
Raised when a RadDockTransaction is successfully committed. Allows listeners to perform some additional operations.
public event RadDockTransactionEventHandler TransactionCommitted
Raised when a RadDockTransaction is about to be committed. Allows listeners to investigate the transaction, perform some additional actions and/or cancel it.
public event RadDockTransactionCancelEventHandler TransactionCommitting