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. --- .../Tango.MachineStudio.Common/StudioViewModel.cs | 117 ++++++++++++++++++++- 1 file changed, 112 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs index 6b7984faf..30e96bd0a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs @@ -7,19 +7,126 @@ using Tango.SharedUI; namespace Tango.MachineStudio.Common { - public abstract class StudioViewModel : ViewModel + /// + /// Represents a Machine Studio view model + /// + /// The type of the module. + /// + /// + public abstract class StudioViewModel : ViewModel, IStudioViewModel where Module : IStudioModule { - public abstract Task RequestShutdown(); + /// + /// Initializes a new instance of the class. + /// + public StudioViewModel() : base() + { + + } + + /// + /// Called when another module has wants to navigate to this module with some arguments. + /// + /// The arguments. + public virtual void OnModuleRequest(params object[] args) + { + + } + + /// + /// Called when the user has navigated out of the module. + /// + public virtual void OnNavigatedFrom() + { + + } + + /// + /// Called when the user has navigated in to the module. + /// + public virtual void OnNavigatedTo() + { + + } + + /// + /// Called before the application is shutting down. + /// Return false to cancel the shutdown in case an important process is in progress. + /// + /// + public virtual Task OnShutdownRequest() + { + return Task.FromResult(true); + } + + /// + /// Called when application is shutting down. + /// + public virtual void OnShuttingDown() + { + + } } - public abstract class StudioViewModel : ViewModel where T : IView + /// + /// Represents a Machine Studio view model. + /// + /// The type of the module. + /// + /// + /// + public abstract class StudioViewModel : ViewModel, IStudioViewModel where Module : IStudioModule where T : IView { - public abstract Task OnShutdownRequest(); - + /// + /// Initializes a new instance of the class. + /// + /// The view. public StudioViewModel(T view) : base(view) { } + + /// + /// Called when another module has wants to navigate to this module with some arguments. + /// + /// The arguments. + public virtual void OnModuleRequest(params object[] args) + { + + } + + /// + /// Called when the user has navigated out of the module. + /// + public virtual void OnNavigatedFrom() + { + + } + + /// + /// Called when the user has navigated in to the module. + /// + public virtual void OnNavigatedTo() + { + + } + + /// + /// Called before the application is shutting down. + /// Return false to cancel the shutdown in case an important process is in progress. + /// + /// + public virtual Task OnShutdownRequest() + { + return Task.FromResult(true); + } + + /// + /// Called when application is shutting down. + /// + public virtual void OnShuttingDown() + { + + } } } -- cgit v1.3.1