From de099bd3b50b8ea52b212b8d322626582c2648be Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 22 Apr 2018 13:35:22 +0300 Subject: Implemented new TangoIOC container & TangoMessenger. Got rid of MVVMLite libs ! Got rid of IShutdownRequestBlocker, IShutdownListener, IModuleRequestListener. Implemented IStudioViewModel & StudioViewModel. --- .../ViewModels/MainViewVM.cs | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index e8e7170b1..6a3b232d5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -19,11 +19,11 @@ using Tango.BL; namespace Tango.MachineStudio.MachineDesigner.ViewModels { - public class MainViewVM : ViewModel, IModuleRequestListener + public class MainViewVM : StudioViewModel { private bool _isSaving; private INotificationProvider _notification; - + #region Properties @@ -156,8 +156,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels SaveCommand = new RelayCommand(Save, (x) => !_isSaving); AddIdsCommand = new RelayCommand(AddIds, (x) => !_isSaving && Configuration.IdsPacks.Count < 8); RemoveIdsCommand = new RelayCommand(RemoveIds, (x) => !_isSaving && SelectedIds != null); - SetVersionConfigurationCommand = new RelayCommand(SetVersionConfiguration,(x) => !_isSaving); - SetAsDefaultCommand = new RelayCommand(SetAsDefaultConfiguration,(x) => !_isSaving); + SetVersionConfigurationCommand = new RelayCommand(SetVersionConfiguration, (x) => !_isSaving); + SetAsDefaultCommand = new RelayCommand(SetAsDefaultConfiguration, (x) => !_isSaving); } #endregion @@ -615,7 +615,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels /// private void SetAsDefaultConfiguration() { - _notification.ShowModalDialog(async (vm) => + _notification.ShowModalDialog(async (vm) => { try { @@ -644,7 +644,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels _notification.ShowError(ex.Message); } - }, () => + }, () => { }); @@ -652,20 +652,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels #endregion - #region IModuleRequestListener + #region IStudioModuleVM - /// - /// Called when the request has been made. - /// - /// The module instance. - /// The arguments. - public void OnRequestModule(IStudioModule module, object args) + public override void OnModuleRequest(params object[] args) { - if (module is MachineDesignerModule) - { - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == (args as Machine).Guid); - } - } + SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == (args[0] as Machine).Guid); + } #endregion } -- cgit v1.3.1