Event after Changed DockMode of C1DockTabControl

Posted by: vinothkumar.ravi on 10 November 2020, 10:42 pm EST

    • Post Options:
    • Link

    Posted 10 November 2020, 10:42 pm EST

    Hi,

    I have two C1DockTabControl inside C1DockControl. When I am dragging any C1DockTabControl immediately ItemDockModeChanged event (i.e. event of C1DockControl) getting fired. If am not docking the DockTabControl and simply leaving it in the floating mode the other control occupying entire space. C1DockControl which I dragged remains same in floating mode. Is there any events available to find after floating is completed.

    Any suggestion please.

    Please refer the attached image.

    Thanks and Regards,

    Vinoth Kumar Ravi

  • Posted 10 November 2020, 10:43 pm EST - Updated 3 October 2022, 11:48 pm EST

  • Posted 12 November 2020, 4:48 am EST

    Hi Vinoth,

    There are no direct events that fire just for the time when the floating is completed. May be you can try to use general events like MouseLeftButtonUp and check the Parent of the floating C1DockTabControl (the parent should be null, when tab is floating).

    Also, can you share your use-case why you wish to detect float complete?

    Regards,

  • Posted 12 November 2020, 5:54 pm EST

    Hi Ruchir,

    Thanks for the update. Reason I want to detect float complete because I want C1DockTabControl needs to be always docked. Also when the floating is completed, Dock Mode changed to Docked but control looks like in floating mode. This creates issue when save and loading the layout for the next time. Expected behavior is C1DockControl should be in Docked Mode always if users changes it also.

    Thanks and Regards,

    Vinoth Kumar Ravi

  • Posted 12 November 2020, 10:09 pm EST

    Hi,

    Thank you for explaining further.

    If you want the tabs to always be docked, then you can instead prevent the user from floating it. This can be done through setting the CanUserFloat property to False.

    Using this you can either prevent floating for selective tabs or for all tabs as follows: ```

    foreach(var child in _dock.Items)

    {

    if(child.GetType()==typeof(C1.WPF.Docking.C1DockTabControl))

    {

    var tab = child as C1.WPF.Docking.C1DockTabControl;

    tab.CanUserFloat = false;

    }

    else if(child.GetType() == typeof(C1.WPF.Docking.C1DockGroup))

    {

    var grp = child as C1.WPF.Docking.C1DockGroup;

    PreventFloat(grp);

    }

    }

    public void PreventFloat(C1.WPF.Docking.C1DockGroup c1DockGroup)
    {
        foreach (var child in c1DockGroup.Items)
        {
            if (child.GetType() == typeof(C1.WPF.Docking.C1DockTabControl))
            {
                var tab = child as C1.WPF.Docking.C1DockTabControl;
                tab.CanUserFloat = false;
            }
            else if(child.GetType() == typeof(C1.WPF.Docking.C1DockGroup))
            {
                var grp = child as C1.WPF.Docking.C1DockGroup;
                PreventFloat(grp);
            }
        }
    }
    ```Regards,
    Ruchir
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels