When a user clicks on a WinForms menu item, this code gets executed:
// this is an Infragistics XamRibbonWindow
var someWpfInfragisticsWindow = new SomeWpfInfragisticsWindow();
ElementHost.EnableModelessKeyboardInterop(someWpfInfragisticsWindow);
someWpfInfragisticsWindow.Show();
The window that is shown is an Infragistics XamRibbonWindow. It also contains an Infragistics XamDataGrid whose DataSource is bound to an IEnumerable property on the view model.
The window also contains a 'Search' button that will retrieve a new collection of items from a database, and set the previously mentioned view model property. This causes the grid to display the new collection.
Later on, the user may close the window. No code was written to handle the close.
My questions are:
- Does closing the window dispose of the window, its controls and make the collection bound to it GC-able (assuming no other references to the collection exist)?
- Does anyone see any potential memory issues with what I've described? Perhaps with the way the items displayed by the grid is updated (or anything else)?