namespace HandBrakeWPF.ViewModels
{
using Caliburn.PresentationFramework.ApplicationModel;
using Microsoft.Practices.ServiceLocation;
///
/// A Base Class for the View Models which contains reusable code.
///
public class ViewModelBase : MultiPresenterManager
{
protected IServiceLocator Locator { get; private set; }
public ViewModelBase(IServiceLocator locator)
{
this.Locator = locator;
}
public void Show() where T : IPresenter
{
this.ShutdownCurrent();
this.Open(Locator.GetInstance());
}
public void ShowDialog() where T : IPresenter
{
Locator.GetInstance().ShowDialog(Locator.GetInstance());
}
public void Popup() where T : IPresenter
{
Locator.GetInstance().Show(Locator.GetInstance());
}
}
}