Category / Section
How to hide the header of the DockingChild?
1 min read
The header of the dock child can be hidden by using the NoHeader property, an attached property of the DockingManager. The NoHeader property is Boolean. This property hides the header of the dock child depending upon its value. When the NoHeader property is set to true, the header of the dock child is hidden and when the NoHeader property is set to false, the header of the dock child is visible. The same has been demonstrated in the following code example:
XAML
// Sets the NoHeader property to true for the DockingManager. <Window x:Class="DockingManager_floatwindowsample.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="Dock1" UseDocumentContainer="True" > <ContentControl syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.State="Dock" syncfusion:DockingManager.NoHeader="True"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock2" syncfusion:DockingManager.State="Dock"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock3" syncfusion:DockingManager.State="Dock"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock4" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock5" syncfusion:DockingManager.State="Document"> </ContentControl> </syncfusion:DockingManager> </Grid> </Window>
C#
// Sets the NoHeader property to true for the DockingManager. using Syncfusion.Windows.Tools.Controls; namespace DockingManager_floatwindowsample { /// <summary> /// Interaction logic for MainWindow.xaml. /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager Docking = new DockingManager(); Docking.UseDocumentContainer = true; ContentControl content1 = new ContentControl(); DockingManager.SetHeader(content1, "Dock1"); DockingManager.SetState(content1, DockState.Dock); DockingManager.SetNoHeader(content1, true); ContentControl content2 = new ContentControl(); DockingManager.SetHeader(content2, "Dock2"); DockingManager.SetState(content2, DockState.Dock); ContentControl content3 = new ContentControl(); DockingManager.SetHeader(content3, "Dock3"); DockingManager.SetState(content3, DockState.Dock); ContentControl content4 = new ContentControl(); DockingManager.SetHeader(content4, "Dock4"); DockingManager.SetState(content4, DockState.Document); Docking.Children.Add(content1); Docking.Children.Add(content2); Docking.Children.Add(content3); Docking.Children.Add(content4); Grid1.Children.Add(Docking); }}}
The following screenshot shows the header of the specified child hidden from the DockingManager:
Figure 1: Header of the specified child hidden
XAML
// Sets the NoHeader property to false for the DockingManager. <Window x:Class="DockingManager_floatwindowsample.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="Dock1" UseDocumentContainer="True" > <ContentControl syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.State="Dock" syncfusion:DockingManager.NoHeader="False"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock2" syncfusion:DockingManager.State="Dock"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock3" syncfusion:DockingManager.State="Dock"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock4" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock5" syncfusion:DockingManager.State="Document"> </ContentControl> </syncfusion:DockingManager> </Grid> </Window>
C#
// Sets the NoHeader property to false for the DockingManager. using Syncfusion.Windows.Tools.Controls; namespace DockingManager_floatwindowsample { /// <summary> /// Interaction logic for MainWindow.xaml. /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager Docking = new DockingManager(); Docking.UseDocumentContainer = true; ContentControl content1 = new ContentControl(); DockingManager.SetHeader(content1, "Dock1"); DockingManager.SetState(content1, DockState.Dock); DockingManager.SetNoHeader(content1, false); ContentControl content2 = new ContentControl(); DockingManager.SetHeader(content2, "Dock2"); DockingManager.SetState(content2, DockState.Dock); ContentControl content3 = new ContentControl(); DockingManager.SetHeader(content3, "Dock3"); DockingManager.SetState(content3, DockState.Dock); ContentControl content4 = new ContentControl(); DockingManager.SetHeader(content4, "Dock4"); DockingManager.SetState(content4, DockState.Document); Docking.Children.Add(content1); Docking.Children.Add(content2); Docking.Children.Add(content3); Docking.Children.Add(content4); Grid1.Children.Add(Docking); } }
The following screenshot shows the header of the child visible in the DockingManager.
Figure 2: Header of the child visible