We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to restrict float functionality for the docking child in WPF DockingManager?

Platform: WPF |
Control: DockingManager |
Published Date: December 11, 2015 |
Last Revised Date: August 3, 2021

To restrict the docking child being get changed to float, set the CanFloat an attached property of WPF DockingManager need to set to False for particular docking child. By default, its value is True.

XAML

<Window x:Class="Application_New.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
                Title="MainWindow" Height="350" Width="525">
<Grid x:Name="Grid1">
<syncfusion:DockingManager x:Name="DockingManager" UseDocumentContainer="True" >
<ContentControl syncfusion:DockingManager.Header="Child1" x:Name="Content1"/>
<ContentControl syncfusion:DockingManager.Header="Child2" x:Name="Content2"
                            syncfusion:DockingManager.CanFloat="False"/>
<ContentControl syncfusion:DockingManager.Header="Child3" x:Name="Content3"/>
</syncfusion:DockingManager>
</Grid>
</Window>

 

C#:

using Syncfusion.Windows.Tools.Controls;
namespace Application_New
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DockingManager DockingManager = new DockingManager();
            DockingManager.UseDocumentContainer = true;
            ContentControl content1 = new ContentControl();
            DockingManager.SetHeader(content1, "Child1");
            ContentControl content2 = new ContentControl();
            DockingManager.SetHeader(content2, "Child2");
            DockingManager.SetCanFloat(content2, false);
            ContentControl content3 = new ContentControl();
            DockingManager.SetHeader(content3, "Child3");
            DockingManager.Children.Add(content1);
            DockingManager.Children.Add(content2);
            DockingManager.Children.Add(content3);
            Grid1.Children.Add(DockingManager);
        }
    }
}

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile