aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-13 15:19:55 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-13 15:19:55 +0200
commit2a51f05523c1397b77eca5e5188520919205638c (patch)
treeedc40c2ca201be6e881ea6746469fb5cb412e8bc /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
parent2c376ac3ae651dd6c6592cc4cbf72768dc97a93d (diff)
downloadTango-2a51f05523c1397b77eca5e5188520919205638c.tar.gz
Tango-2a51f05523c1397b77eca5e5188520919205638c.zip
Successfully separated Machine Studio to modules...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
new file mode 100644
index 000000000..0f9666137
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
@@ -0,0 +1,68 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Ioc;
+using Microsoft.Practices.ServiceLocation;
+using Tango.MachineStudio.DB.ViewModels;
+using Tango.MachineStudio.DB.ViewModels.DBViewModels;
+
+namespace Tango.MachineStudio.DB
+{
+ /// <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>();
+ SimpleIoc.Default.Register<MachinesViewVM>();
+ SimpleIoc.Default.Register<OrganizationsViewVM>();
+ SimpleIoc.Default.Register<AddressesViewVM>();
+ SimpleIoc.Default.Register<UsersViewVM>();
+ }
+
+ public static MainViewVM MainViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<MainViewVM>();
+ }
+ }
+
+ public static MachinesViewVM MachinesViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<MachinesViewVM>();
+ }
+ }
+
+ public static OrganizationsViewVM OrganizationsViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<OrganizationsViewVM>();
+ }
+ }
+
+ public static AddressesViewVM AddressesViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<AddressesViewVM>();
+ }
+ }
+
+ public static UsersViewVM UsersViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<UsersViewVM>();
+ }
+ }
+ }
+} \ No newline at end of file