aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
committerAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
commit6c208c90bc45aff4a7fa214356a42fe7757c5e6f (patch)
tree0d77bc6a0ecfbb53cf42c5462ee19212197ee1bd /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs
parentb0823127f152fe97a6e8fce29e427c7f3db9cf5a (diff)
parent1a573aaa346ec4b8bd58a0e35ab9df571a09b855 (diff)
downloadTango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.tar.gz
Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.zip
MERGE
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.cs36
1 files changed, 36 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..c5ed7d385
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs
@@ -0,0 +1,36 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Ioc;
+using Microsoft.Practices.ServiceLocation;
+using Tango.MachineStudio.Developer.Navigation;
+using Tango.MachineStudio.Developer.ViewModels;
+using Tango.MachineStudio.Developer.Views;
+
+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<IMainView>(() => MainView.Instance);
+ SimpleIoc.Default.Register<MainViewVM>();
+ SimpleIoc.Default.Register<DeveloperNavigationManager, DeveloperNavigationManager>();
+ }
+
+ public static MainViewVM MainViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<MainViewVM>();
+ }
+ }
+ }
+} \ No newline at end of file