diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index ceb81a66f..fcbdc90a3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -23,12 +23,19 @@ using Tango.Transport.Adapters; namespace Tango.MachineStudio.UI.ViewModels { + /// <summary> + /// Represents the Machine Studio main view, view model. + /// </summary> + /// <seealso cref="Tango.SharedUI.ViewModel{Tango.MachineStudio.UI.SupervisingController.IMainView}" /> public class MainViewVM : ViewModel<IMainView> { private IStudioModule _currentModule; private INavigationManager _navigation; private bool _isDisconnecting; + /// <summary> + /// Gets or sets the current loaded module. + /// </summary> public IStudioModule CurrentModule { get { return _currentModule; } @@ -36,33 +43,54 @@ namespace Tango.MachineStudio.UI.ViewModels } private bool _isModuleLoaded; - + /// <summary> + /// Gets or sets a value indicating whether any module is loaded at the moment. + /// </summary> public bool IsModuleLoaded { get { return _isModuleLoaded; } set { _isModuleLoaded = value; RaisePropertyChangedAuto(); } } - private bool _isMenuOpened; - + /// <summary> + /// Gets or sets a value indicating whether the side menu is opened. + /// </summary> public bool IsMenuOpened { get { return _isMenuOpened; } set { _isMenuOpened = value; RaisePropertyChangedAuto(); } } + /// <summary> + /// Gets or sets the start module command. + /// </summary> public RelayCommand<IStudioModule> StartModuleCommand { get; set; } + /// <summary> + /// Gets or sets the home command. + /// </summary> public RelayCommand HomeCommand { get; set; } + /// <summary> + /// Gets or sets the connect command. + /// </summary> public RelayCommand ConnectCommand { get; set; } + /// <summary> + /// Gets or sets the disconnect command. + /// </summary> public RelayCommand DisconnectCommand { get; set; } + /// <summary> + /// Gets or sets the sign-out command. + /// </summary> public RelayCommand SignoutCommand { get; set; } private IAuthenticationProvider _authenticationProvider; + /// <summary> + /// Gets or sets the authentication provider. + /// </summary> public IAuthenticationProvider AuthenticationProvider { get { return _authenticationProvider; } @@ -70,7 +98,9 @@ namespace Tango.MachineStudio.UI.ViewModels } private IStudioModuleLoader _studioModuleLoader; - + /// <summary> + /// Gets or sets the studio module loader. + /// </summary> public IStudioModuleLoader StudioModuleLoader { get { return _studioModuleLoader; } @@ -78,7 +108,9 @@ namespace Tango.MachineStudio.UI.ViewModels } private INotificationProvider _notificationProvider; - + /// <summary> + /// Gets or sets the notification provider. + /// </summary> public INotificationProvider NotificationProvider { get { return _notificationProvider; } @@ -86,15 +118,24 @@ namespace Tango.MachineStudio.UI.ViewModels } private IStudioApplicationManager _applicationManager; - + /// <summary> + /// Gets or sets the application manager. + /// </summary> public IStudioApplicationManager ApplicationManager { get { return _applicationManager; } set { _applicationManager = value; RaisePropertyChangedAuto(); } } - - + /// <summary> + /// Initializes a new instance of the <see cref="MainViewVM"/> class. + /// </summary> + /// <param name="view">The view.</param> + /// <param name="authenticationProvider">The authentication provider.</param> + /// <param name="studioModuleLoader">The studio module loader.</param> + /// <param name="notificationProvider">The notification provider.</param> + /// <param name="applicationManager">The application manager.</param> + /// <param name="navigationManager">The navigation manager.</param> public MainViewVM( IMainView view, IAuthenticationProvider authenticationProvider, @@ -117,6 +158,9 @@ namespace Tango.MachineStudio.UI.ViewModels DisconnectCommand = new RelayCommand(DisconnectFromMachine, (x) => ApplicationManager.IsMachineConnected && !_isDisconnecting); } + /// <summary> + /// Disconnected from the current connected machine. + /// </summary> private async void DisconnectFromMachine() { using (_notificationProvider.PushTaskItem("Disconnecting from machine...")) @@ -130,6 +174,9 @@ namespace Tango.MachineStudio.UI.ViewModels } } + /// <summary> + /// Signs-out the current logged-in user. + /// </summary> private void SignOut() { _authenticationProvider.Logout(); @@ -138,6 +185,9 @@ namespace Tango.MachineStudio.UI.ViewModels IsMenuOpened = false; } + /// <summary> + /// Opens the machine connection dialog to allow the user to scan and connect to remote machines view USB/TCP. + /// </summary> private void ConnectToMachine() { _notificationProvider.ShowModalDialog<MachineConnectionViewVM>(async (x) => @@ -209,11 +259,18 @@ namespace Tango.MachineStudio.UI.ViewModels }); } + /// <summary> + /// Navigates to the home screen. + /// </summary> private void Home() { StartModule(null); } + /// <summary> + /// Starts the specified module. + /// </summary> + /// <param name="module">The module.</param> private void StartModule(IStudioModule module) { IsMenuOpened = false; @@ -229,6 +286,9 @@ namespace Tango.MachineStudio.UI.ViewModels } } + /// <summary> + /// Called when the <see cref="T:Tango.SharedUI.IView" /> is loaded and attached. + /// </summary> protected override void OnViewAttached() { base.OnViewAttached(); |
