update to v1.2.0
This commit is contained in:
1 parent
c402f428fb
commit
4afd1097de
90 files changed
+2992
-1652
No files matched your search
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using CommonServiceLocator;
|
||||
using GalaSoft.MvvmLight.Ioc;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ViewModelLocator
|
||||
{
|
||||
public ViewModelLocator()
|
||||
{
|
||||
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
|
||||
|
||||
SimpleIoc.Default.Register<MainViewModel>();
|
||||
SimpleIoc.Default.Register<GrowlDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ImageBrowserDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
Application.Current.TryFindResource("Locator") as ViewModelLocator).Value;
|
||||
|
||||
#region Vm
|
||||
|
||||
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
|
||||
|
||||
public GrowlDemoViewModel GrowlDemo => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>();
|
||||
|
||||
public ImageBrowserDemoViewModel ImageBrowserDemo => ServiceLocator.Current.GetInstance<ImageBrowserDemoViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user