mirror of
https://github.com/jie65535/Helpers.git
synced 2025-06-01 17:29:12 +08:00
22 lines
540 B
C#
22 lines
540 B
C#
using CommonServiceLocator;
|
|
using GalaSoft.MvvmLight.Ioc;
|
|
|
|
namespace MvvmLightDemo.ViewModel
|
|
{
|
|
public class ViewModelLocator
|
|
{
|
|
public ViewModelLocator()
|
|
{
|
|
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
|
|
SimpleIoc.Default.Register<MainViewModel>();
|
|
}
|
|
|
|
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
|
|
|
|
public static void Cleanup()
|
|
{
|
|
// TODO Clear the ViewModels
|
|
}
|
|
}
|
|
}
|