How to properly close a window that may be reinstantiated multiple times

Hi,

In the thread in the link below, I learned that a window doesn't actually close when the user clicks the X button.

https://www.syncfusion.com/forums/174136/how-to-hide-a-window-instead-of-closing-it?reply=S2UZAD

The above thread is useful if I want a window to persist with a specific user control that I can use multiple times.


However, in a new use case, I have a generic user control in a window that may be reinstantiated multiple times

Let's use an example like a stock charting system where you can open and close multiple charts. In this example, I could open 10 charts, close 5 and open another 10....etc. But when I close a chart window, I would want it to dispose and it's resources to be collected so as not to create a memory leak of all the windows/controls in the hidden state.

What is the proper way to handle this with Docking Manager windows?


1 Reply 1 reply marked as answer

GT Gokul Thanudhas Syncfusion Team April 12, 2022 09:27 AM UTC

Hi Lorenzo,


Please refer the below link to clear or remove the memory while closing the window


How to release memory in DockingManager after closing the tab? | WPF - DockingManager (syncfusion.com)


Regards,

Gokul T



Marked as answer
Loader.
Up arrow icon