Hello everyone,
I have created a small application that, basically, exists in the system tray and the user only needs to open the actual application in VERY few cases. The problem is, that once the suer opened the application for the first time, the memory is filled up with an awful lot of data (WPF UI for datagrids, treeviews etc). But then the user will minimise the application again and it will sit there for most of the time. The only UI that is always accessible is the tray icon's contextmenu.
So here is the thing: How can I dispose of the WHOLE UI every time the application is minimised? I have tried several things in WPF but I can never get rid of the UI objects as WPF keeps references to them.
What I would love is: Open application (UI loaded) --> Minimise to tray --> Whole UI disposed and the only memory left is that used by the business logic... Next time application is opened from the tray: Whole UI is rebuilt.
Thank you very much in advance!