diff options
author | sr55 <[email protected]> | 2011-03-11 19:35:20 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-03-11 19:35:20 +0000 |
commit | 8901833d80d4435650620a71956ee3101c5eb946 (patch) | |
tree | 6b1e459730079cedeef7e019a53c0e0d9c9b8303 /win/C#/HandBrakeWPF/ViewModels/ViewModelBase.cs | |
parent | 483648b11af3d0c9b3de4bfc6d7d4b6b0b125e1a (diff) |
WinGui:
- Update Caliburn to 2.0RC, update the current source files to work with the new version. Introduces MEF to the project.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3836 b64f7644-9d1e-0410-96f1-a4d463321fa5
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; }
}
}
|