Articles in this section
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;
        }
    }
}
 

 

Collapse header panel in document container

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied