diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-01-31 10:11:27 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-01-31 10:11:27 +0200 |
| commit | b55483f9f095b699728e0b587ceebfdf6409a48a (patch) | |
| tree | 1d424d3fc9f75154ecae30806b952fdfb029fce9 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs | |
| parent | e027cb9fdd17fe3be7bb2c385dc37061a7eea8bb (diff) | |
| parent | 2fa92ca3654ebb274482f9bad86231028d357e5a (diff) | |
| download | Tango-b55483f9f095b699728e0b587ceebfdf6409a48a.tar.gz Tango-b55483f9f095b699728e0b587ceebfdf6409a48a.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs new file mode 100644 index 000000000..f11cee8d0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs @@ -0,0 +1,31 @@ +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Ioc; +using Microsoft.Practices.ServiceLocation; +using Tango.MachineStudio.Developer.ViewModels; + +namespace Tango.MachineStudio.Developer +{ + /// <summary> + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// </summary> + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); + SimpleIoc.Default.Register<MainViewVM>(); + } + + public static MainViewVM MainViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MainViewVM>(); + } + } + } +}
\ No newline at end of file |
