You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MetroWindow with mah:DialogParticipation.Register="{Binding}" doesn't get disposed after the ShowDialog() call.
Example usage: I have two windows - MainWindow and MyDialogView. Each has it's own view model - MainWindowViewModel and MyDialogViewModel.
MainWindowViewModel contains a OpenDialogCommand, which opens the dialog view.
MyDialogViewModel contains a CloseCommand, which raises an OnClose event. The MainWindowViewModel handles the OnClose event and closes the dialog window.
For easier debugging I instantiate a large byte array in the MyDialogViewModel constructor. If I open and close the dialog window multiple times the memory usage only increases (by 1GB). But if I remove the DialogParticipation.Register parameter, then the memory usage gets decreased when the garbage collector runs.
One question - I tried to unregister even if I didn't register before and it looks OK. Is it wrong to unregister all MetroWindows by default, event I you don't use DialogParticipation at all?
I am using MahApps.Metro, v1.6.5.
MetroWindow with
mah:DialogParticipation.Register="{Binding}"
doesn't get disposed after the ShowDialog() call.Example usage: I have two windows - MainWindow and MyDialogView. Each has it's own view model - MainWindowViewModel and MyDialogViewModel.
MainWindowViewModel contains a OpenDialogCommand, which opens the dialog view.
MyDialogViewModel contains a CloseCommand, which raises an OnClose event. The MainWindowViewModel handles the OnClose event and closes the dialog window.
For easier debugging I instantiate a large byte array in the MyDialogViewModel constructor. If I open and close the dialog window multiple times the memory usage only increases (by 1GB). But if I remove the DialogParticipation.Register parameter, then the memory usage gets decreased when the garbage collector runs.
I prepared an example here
The text was updated successfully, but these errors were encountered: