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 release memory in DockingManager after closing the tab?

Platform: WPF |
Control: DockingManager

Remove the child from DockingManager

Closed children are moved to the “Hidden dock state so that it does not release memory. You have to manually remove the children from DockingManager in DockStateChanged event.

Remove memory held by Automation peer

DocumentContainer of DockingManager is derived from the base of Tab control. Normally TabItems Automation peer holds some memory. That memory also needs to be released by the FakeWindowAutomationPeer method as follows.

Create FakeWindowAutomationPeer class

Create a new class derived from WindowAutomationPeer class and define the override method GetChildrenCore(), and define OnCreateAutomationPeer() override method in MainWindow.



public partial class MainWindow : Window


   public MainWindow()




//Remove child from DockingManager

   private void Docking_DockStateChanged(FrameworkElement sender, DockStateEventArgs e)





   protected override AutomationPeer OnCreateAutomationPeer()


       return new FakeWindowsPeer(this);



public class FakeWindowsPeer : WindowAutomationPeer


    public FakeWindowsPeer(Window window): base(window)

    { }

    protected override List<AutomationPeer> GetChildrenCore()


        return null;





2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment
Andrew Conniff
Feb 08, 2016
My Issue is I am getting an error that Dockingmanager contains no definition for 'Children' am I missing an assembly reference? But I am getting Docking Manager in the code so I have ausing statement of using Syncfusion.Windows.Forms.Tools; Reply
Not Known
Feb 09, 2016
Hi Andrew, Please use the namespace as "using Syncfusion.Windows.Tools.Controls;" for WPF DockingManager control. Regards, Jessie
May 19, 2017
I have some question. What if after closing the tab I want to decide to remove or hide window, depands of element dock state. For exemple if element is in document dock state should be remove but in other state should be hidden. At this scenario I should  create FakeWindowAutomationPeer class?

Marimuthu Sivalingam [Syncfusion]
May 19, 2017
Hi ElolT,

Yes, if you want to remove the child from DockingManager you should add FakeWindowAutomationPeer class otherwise not necessary. 

Marimuthu S.

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