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 find whether the AutoHidden element in WPF DockingManager is expanded or collapsed?

Platform: WPF |
Control: DockingManager |
Published Date: November 14, 2016 |
Last Revised Date: August 3, 2021

This article describes how to find whether the side panel in DockingManager is expanded or collapsed. Follow the below steps to get notified when auto hidden content panel expands and collapses.

Retrieve SidePanels

Retrieve the SidePanels in WPF DockingManager by traversing visual tree and identify their sides with the help of PanelSide poperty.

SidePanel events

The SidePanel class has the events Show and Hide, hook these events for each side. Show event notifies user when the panel is being expanded and Hide event notifies user when the panel is being collapsed.

The following code example demonstrates the same.


    <RowDefinition Height="60"/>
  <StackPanel Orientation="Vertical">
    <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
                <TextBlock Text="Panel Event: " Margin="5 0 0 0" FontSize="16"/>
                <TextBlock x:Name="showHideEventText" FontSize="16" Foreground="Green" FontStyle="Italic"/>
  <syncfusion:DockingManager Grid.Row="1" x:Name="dockingManager" DockFill="True" Loaded="dockingManager_Loaded">
    <ContentControl x:Name="left" syncfusion:DockingManager.Header="Left" syncfusion:DockingManager.SideInDockedMode="Left" syncfusion:DockingManager.State="AutoHidden" />            


private void dockingManager_Loaded(object sender, RoutedEventArgs e)
  foreach (SidePanel panel in FindVisualChildrenOfType<SidePanel>(dockingManager))
    if (panel.PanelSide == Dock.Left) 
      panel.ShowEvent += Panel_ShowEvent;
      panel.HideEvent += Panel_HideEvent;
  dockingManager.Loaded -= dockingManager_Loaded;
private void Panel_HideEvent(object sender, RoutedEventArgs e)
  showHideEventText.Text = "Hide";
private void Panel_ShowEvent(object sender, RoutedEventArgs e)
  showHideEventText.Text = "Show";
public static IEnumerable<T> FindVisualChildrenOfType<T>(DependencyObject parent) where T : DependencyObject
  List<T> foundChildren = new List<T>();
  int childCount = VisualTreeHelper.GetChildrenCount(parent);
  for (int i = 0; i < childCount; i++)
    var child = VisualTreeHelper.GetChild(parent, i);
    T childType = child as T;
    if (childType == null)
      foreach (var other in FindVisualChildrenOfType<T>(child))
        yield return other;
      yield return (T)child;


Side panel item hovered to view the content in WPF DockingManager

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
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