Category / Section
How to collapse the header panel in DocumentContainer of WPF DockingManager?
1 min read
The HeaderPanel of DocumentContainer can be collapsed by setting the header panel’s visibility to collapse by fetch HeaderPanel from VisualTree of DocumentContainer in WPF DockingManager.
MainWindow.Xaml
<syncfusion:DockingManager x:Name="dockingmanager" UseDocumentContainer="True"> <ContentControl x:Name="Properties" syncfusion:DockingManager.Header="Properties"/> <ContentControl x:Name="Tools" syncfusion:DockingManager.Header="Tools" syncfusion:DockingManager.State="Document"/> <ContentControl x:Name="Solution" syncfusion:DockingManager.Header="Solution" syncfusion:DockingManager.State="Document"/> </syncfusion:DockingManager>
C#
namespace DockingManagerSample { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); (dockingmanager.DocContainer as DocumentContainer).Loaded += MainWindow_Loaded; } void MainWindow_Loaded(object sender, RoutedEventArgs e) { HeaderPanel header = VisualUtils.FindDescendant(sender as Visual, typeof(HeaderPanel)) as HeaderPanel; header.Visibility = Visibility.Collapsed; } } }