How to enable and disable the floating of Documents on doubleclicking its header in the DockingManager?
A document can float on double clicking its header by using the property, EnableDocumentToFloatOnDoubleClick of the DockingManager. This behavior can be enabled or disabled based on its values. When the value of the EnableDocumentToFloatOnDoubleClick property is set to true, the document of the DockingManager children floats on double clicking the document’s header. When the value of the EnableDocumentToFloatOnDoubleClick property is set to false, the document state of the DockingManager children does not float on double clicking the document’s header.
The same has been explained in the following code example:
XAML
//Sets the value as true in the EnableDocumentToFloatOnDoubleClick property. <Window 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" x:Class="Forum_New.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid Name="Grid1"> <syncfusion:DockingManager x:Name="Docking1" UseDocumentContainer="True" EnableDocumentToFloatOnDoubleClick="True" > <ContentControl Name="Content1" syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Document1"/> <ContentControl Name="Content2" syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Document2"/> </syncfusion:DockingManager> </Grid> </Window>
C#
//Sets the value as true in the EnableDocumentToFloatOnDoubleClick property. using Syncfusion.Windows.Tools.Controls; namespace Forum_New { /// <summary> /// Interaction logic for MainWindow.xaml. /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager Docking1 = new DockingManager(); Docking1.EnableDocumentToFloatOnDoubleClick = true; Docking1.UseDocumentContainer = true; ContentControl content1 = new ContentControl(); DockingManager.SetHeader(content1, "Document1"); DockingManager.SetState(content1, DockState.Document); ContentControl content2 = new ContentControl(); DockingManager.SetHeader(content2, "Document2"); DockingManager.SetState(content2, DockState.Document); Docking1.Children.Add(content1); Docking1.Children.Add(content2); Grid1.Children.Add(Docking1); } } }
The following screenshot shows how the document floats on double clicking the document’s Header when the value is set to true:
The following code disables floating the document on double clicking its header in the DockingManager.
XAML
//Sets the value to false in the EnableDocumentToFloatOnDoubleClick property: <Window 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" x:Class="Forum_New.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid Name="Grid1"> <syncfusion:DockingManager x:Name="Docking1" UseDocumentContainer="True" EnableDocumentToFloatOnDoubleClick="False" > <ContentControl Name="Content1" syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Document1"/> <ContentControl Name="Content2" syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Document2"/> </syncfusion:DockingManager> </Grid> </Window>
C#
//Sets the value to false in the EnableDocumentToFloatOnDoubleClick property: using Syncfusion.Windows.Tools.Controls; namespace Forum_New /// <summary> /// Interaction logic for MainWindow.xaml. /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager Docking1 = new DockingManager(); Docking1.EnableDocumentToFloatOnDoubleClick = false; Docking1.UseDocumentContainer = true; ContentControl content1 = new ContentControl(); DockingManager.SetHeader(content1, "Document1"); DockingManager.SetState(content1, DockState.Document); ContentControl content2 = new ContentControl(); DockingManager.SetHeader(content2, "Document2"); DockingManager.SetState(content2, DockState.Document); Docking1.Children.Add(content1); Docking1.Children.Add(content2); Grid1.Children.Add(Docking1); } } }
The following output shows that the document does not float on double clicking the document’s header when the value is set to false: