We have used Caliburn Micro for a long time with .NET Framework (and an older version of CM). I have now upgraded the whole solution to .NET 8 and CM to the latest version. One thing I notice is that closing a window (screen), and then reopening it throws exceptions, like:
Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed
.
The typical process of opening the window is to create a new viewmodel (not by means of DI), and opening it with
await _windowManager.ShowWindowAsync(vm);
Closing it is by await TryCloseAsync();
inside the viewmodel.
Re-opening the window by the same process always worked, but not anymore. What changed? Does TryCloseAsync
not actually destroy the window?
Deactivating the child viewmodel seems to have the same effect. Trying to just Activate the viewmodel again does nothing.
1