diff options
Diffstat (limited to 'win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs')
-rw-r--r-- | win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs index c07593b7b..b946d7c7e 100644 --- a/win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs +++ b/win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs @@ -1,35 +1,18 @@ namespace HandBrakeWPF.ViewModels
{
using Caliburn.PresentationFramework.ApplicationModel;
-
- using Microsoft.Practices.ServiceLocation;
+ using Caliburn.PresentationFramework.Screens;
/// <summary>
/// A Base Class for the View Models which contains reusable code.
/// </summary>
- public class ViewModelBase : MultiPresenterManager
+ public class ViewModelBase : Screen
{
- protected IServiceLocator Locator { get; private set; }
-
- public ViewModelBase(IServiceLocator locator)
- {
- this.Locator = locator;
- }
-
- public void Show<T>() where T : IPresenter
+ public ViewModelBase(IWindowManager windowManager)
{
- this.ShutdownCurrent();
- this.Open(Locator.GetInstance<T>());
+ this.WindowManager = windowManager;
}
- public void ShowDialog<T>() where T : IPresenter
- {
- Locator.GetInstance<IWindowManager>().ShowDialog(Locator.GetInstance<T>());
- }
-
- public void Popup<T>() where T : IPresenter
- {
- Locator.GetInstance<IWindowManager>().Show(Locator.GetInstance<T>());
- }
+ public IWindowManager WindowManager { get; private set; }
}
}
|