Add ShowDialog

This commit is contained in:
Antony Male 2014-02-06 12:48:15 +00:00
parent faa1b9a2b5
commit b5e2f8b2e0
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@ namespace Stylet
public interface IWindowManager
{
void ShowWindow(object viewModel);
bool? ShowDialog(object viewModel);
}
public class WindowManager : IWindowManager
@ -21,6 +22,11 @@ namespace Stylet
this.CreateWindow(viewModel, false).Show();
}
public bool? ShowDialog(object viewModel)
{
return this.CreateWindow(viewModel, true).ShowDialog();
}
private Window CreateWindow(object viewModel, bool isDialog)
{
var view = ViewLocator.LocateForModel(viewModel) as Window;