private bool?OpenDialog(IDialogViewModel viewModel, string title, WindowState startState, SizeToContent sizeToContent, WindowStartupLocation startupLocation, Window owner) { LogWindow(owner); Window window = new Window() { WindowState = startState, Title = title, Content = viewModel, SizeToContent = sizeToContent }; window.Closed += WindowOnClosed; window.Owner = owner; window.WindowStartupLocation = startupLocation; viewModel.RegisterWindow(window); return(window.ShowDialog()); }