public class ShellViewModel : Conductor...
private readonly IWindowManager _windowManager;
private readonly Lazy<StartupDialogViewModel> _startupDialog;
public ShellViewModel(IWindowManager windowManager,
Lazy<StartupDialogViewModel> startupDialog)
{
_windowManager = windowManager;
_startupDialog = startupDialog;
}
protected override void OnViewLoaded(object view) {
base.OnViewLoaded(view);
if(_windowManager.ShowDialog(_startupDialog.Value) == true;
}
Exception Details
You cannot set the Owner property to a window that has not been previously shown.
Trace
in System.Windows.Window.set_Owner (window value) in Caliburn.Micro.WindowManager.EnsureWindow (object model, object view, logical isDialog) in Caliburn.Micro.WindowManager.CreateWindow (Object rootModel, Boolean isDialog, Object context IDictionary 2 settings)
at Caliburn.Micro.WindowManager.ShowDialog(Object rootModel, Object context, IDictionary2 settings) in XXXXX.ShellViewModel.OnViewLoaded (object view)
What could be the reason for this? I also tried calling the window managers ShowDialoginside OnViewReady, but no luck.
source
share