Nevron .NET Vision
User Interface for .NET / User's Guide / Docking Panels / Dock Manager

In This Topic
    Dock Manager
    In This Topic
    The NDockManager component is the root object of a Nevron Docking Panels framework. It synchronizes docking panels and docking containers, supports batch operations, observes some events and notifies all dependant components, fires events bubbled to it, etc. It must be assigned a valid form where the root docking container will reside.

    The NDockManager controls most of the aspects of visual representation. It exposes the following styles used to control docking framework's appearance:

    The following example demonstrates how to change the tabs appearance using the TabStyle property:

    Copy Code
    NTabStyle style = this.nDockManager1.TabStyle;
    style.TabAlign = TabAlign.Top;
    style.UseAutomaticTabStyle = false;
    style.TabStyle = TabStyle.Buttons;
    style.Font = new Font("Arial", 9.0f);
    Visual Basic
    Copy Code
    Dim style As NTabStyle = Me.nDockManager1.TabStyle
    style.TabAlign = TabAlign.Top
    style.UseAutomaticTabStyle = false
    style.TabStyle = TabStyle.Buttons
    style.Font = New Font("Arial", 9.0F)

    The result of the above code.

     Adding Containers

    Each element in the docking framework should be attached to a valid NDockManager instance in order to function properly. You should use the manager to create and add docking containers as it will automatically update the container's references. By default when assigned a valid Form instance the manager will add its RootContainer to the Form's controls collection. If you want to add additional nested containers use the manager's AddContainer method.


    The following code demonstrates how to add docking containers:

    Copy Code
    //create a valid manager and attach it to the form
    NDockManager nDockManager1 = new NDockManager();
    nDockManager1.Form = this;
    //create a container
    NDockingPanelContainer container = this.nDockManager1.AddContainer(DockStyle.Fill);
    //add the container as a child to an existing docking panel
    Visual Basic
    Copy Code
    'create a valid manager and attach it to the form
    Dim nDockManager1 As NDockManager = New NDockManager()
    nDockManager1.Form = Me
    'create a container
    Dim container As NDockingPanelContainer = Me.nDockManager1.AddContainer(DockStyle.Fill)
    'add the container as a child to an existing docking panel
    As all unhandled events are bubbled up to the manager it fires the same events as a NDockingPanel but with the prefix "Panel" - for example Activated will be PanelActivated. For more information about docking panels notifications see Docking Panels.
     Batch Operations

    The NDockManager component might start batch operation which actually suspends any layout and notification events.


    The following code demonstrates how to start and end a batch operation:

    Copy Code
    //perform your application-defined job here
    //do not forget to end the batch operation
    Visual Basic
    Copy Code
    'perform your application-defined job here
    'do not forget to end the batch operation
     Framework Updates

    The NDockManager might be used to perform various updates on the entire docking framework.


    The following table describes these methods:


    Method Description


    Forces all the panels with visible caption to re-measure and repaint them.


    Forces all containers and panels to perform layout.


    Notifies all elements in the framework of a palette change.


    Invalidates and updates the entire framework.


    Invalidates and updates all the splitters in the framework.


    Notifies all docking panels that a property regarding tabs appearance has changed.


    Performs a batch of all updates.


    The NDockManager keeps track of all the containers and panels currently being part of the framework. It exposes lots of properties and methods to perform various queries upon framework's elements.


    The following table demonstrates these queries:


    Query Description


    Gets the currently active panel for the framework. There can be only one at a time.


    Gets all the containers registered with the framework. Including both visible and hidden.


    Gets all the docking panels registered with the framework. Includes panels with any DockState.


    Searches for a INDockingPanelContainer with the specified ID.


    Searches for a INDockingPanel with the specified ID.


    Searches for a INDockZone with the specified ID.


    Gets all containers with the specified DockStyle.


    Gets all the panels with the specified DockState.


    The NDockManager provides some sharable object to be used by the entire framework. These are:


    • Renderer - the default renderer to be used by all UI elements in the framework.
    • LayoutEngine - the default layout engine to be used by all the dock zones in the framework.
    • DragHandler - the default INDragHandler implementation to be used by all docking panels.
    See Also