diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs index 2f3419d67..9503e4c38 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs @@ -15,7 +15,7 @@ using Tango.SharedUI; namespace Tango.MachineStudio.DB.ViewModels { - public class MainViewVM : StudioViewModel<DBModule> + public class MainViewVM : StudioViewModel { private bool _isLoading; public bool IsLoading @@ -53,29 +53,34 @@ namespace Tango.MachineStudio.DB.ViewModels NotLoaded = false; } - public override void OnModuleRequest(params object[] args) + public override void OnApplicationReady() { - if (args != null && args.Length > 0 && args[0] is IObservableEntity) - { - var arg = args[0]; + + } - String vmName = arg.GetType().Name + "sViewVM"; + //public override void OnModuleRequest(params object[] args) + //{ + // if (args != null && args.Length > 0 && args[0] is IObservableEntity) + // { + // var arg = args[0]; - Type vmType = Assembly.GetAssembly(typeof(MainViewVM)).GetTypes().SingleOrDefault(x => x.Name == vmName); + // String vmName = arg.GetType().Name + "sViewVM"; - if (vmType == null) - { - vmName = arg.GetType().BaseType.Name + "sViewVM"; - vmType = Assembly.GetAssembly(typeof(MainViewVM)).GetTypes().SingleOrDefault(x => x.Name == vmName); - } + // Type vmType = Assembly.GetAssembly(typeof(MainViewVM)).GetTypes().SingleOrDefault(x => x.Name == vmName); - if (vmType != null) - { - var vm = TangoIOC.Default.GetInstance(vmType); - vmType.GetProperty("SelectedEntity").SetValue(vm, arg); - vmType.GetMethod("OnEdit", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(vm, new object[] { }); - } - } - } + // if (vmType == null) + // { + // vmName = arg.GetType().BaseType.Name + "sViewVM"; + // vmType = Assembly.GetAssembly(typeof(MainViewVM)).GetTypes().SingleOrDefault(x => x.Name == vmName); + // } + + // if (vmType != null) + // { + // var vm = TangoIOC.Default.GetInstance(vmType); + // vmType.GetProperty("SelectedEntity").SetValue(vm, arg); + // vmType.GetMethod("OnEdit", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(vm, new object[] { }); + // } + // } + //} } } |
