In This Topic
    Extending Docking Panels
    In This Topic

    Overview

    A NDockingPanel might be easily extended to provide either custom functionality or appearance or even both. Most of the methods and properties are virtual (overridable). You can specify custom drag handler, renderer, render context, drag size, permissions, etc. as well as perform your own custom logic upon dock or drop operations.

     

    Providing Custom Drag Handler

    Each panel drag operation is handled by a INDragHandler object which is responsible for intercepting messages and redirecting them to the currently dragged panel. By default all panels use the INDragHandler instance provided by the current NDockManager. You may however change this object or specify a new one per panel.

     

    The following code demonstrates how to create and provide custom drag handler:

    [C#]
    
    public class MyDragHandler : NDragHandler
    {
            public MyDragHandler()
            {
            }
    
            public override bool CanDrag(INDraggableControl control)
            {
                    //allow only instances of our custom panel to be dragged
                    if(!(control is MyDockingPanel))
                            return false;
    
                    return base.CanDrag(control);
            }
    }
    
    public class MyDockingPanel : NDockingPanel
    {
            public MyDockingPanel()
            {
                    //specify our custom drag handler
                    DragHandler = new MyDragHandler();
            }
    }
    

     

    Extending Behaviour

    Nevron docking panels functionality might be generally divided into three parts:

     

    • Drag and hittest - methods related with dragging, hittesting, docking hints, etc.
    • Dock and redock - methods related with docking panels on containers, choosing an appropriate dock zone, etc.
    • Float - methods which provide the floating functionality of a panel. 

     

    All of these methods are overridable and might be easily extended.

     

    See Also

    Docking Panels | Docking Containers | Docking Framework Renderer