Skip to main content Skip to footer

How to restrict some docking options for C1DockingTab

With C1DockControl component, you can restrict the any user to place a C1DockTabItem in Floating mode and add drag and drop functionality from one C1DockTabControl to another.

These have two cases:

1. You can drag C1DockTabItem and drop to C1DockTabControl without getting it into floating mode.
2. You can drag C1DockTabItem and drop to its original(previous) position without getting it into floating mode.
        private void Item_MouseDown(object sender, MouseButtonEventArgs e)
        {
            c1DockTabItem = sender as C1DockTabItem;
            currentTabControl = c1DockTabItem.Parent as C1DockTabControl;
            IsItemActive = true;
        }
        private void Mouse_Up(object sender, MouseButtonEventArgs e)
        {
            if (e.Source.GetType() == typeof(C1DockTabControl))
            {
                if (IsFloating)
                {
                    (c1DockTabItem.Parent as C1DockTabControl).Items.Remove(c1DockTabItem);
                    currentTabControl.Items.Add(c1DockTabItem);
                    dockControl.Items.RemoveAt(dockControl.Items.Count - 1);
                }
                IsFloating = false;
            }
        }