aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-07 16:09:29 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-07 16:09:29 +0200
commitfc50a3a0f5c1a7de61dd169ca175f3690177059a (patch)
tree8efd928c974806957fd06d4bfdcafbfc45268cb6 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels
parent3f5ba302842a906950b118c7f6683c061819d76e (diff)
downloadTango-fc50a3a0f5c1a7de61dd169ca175f3690177059a.tar.gz
Tango-fc50a3a0f5c1a7de61dd169ca175f3690177059a.zip
Implemented LogOut from machine studio.
Modified Machine Designer image. Fixed issue with updating contact on DB Module. Improved Machine Studio Drawer graphics.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs21
1 files changed, 18 insertions, 3 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 92c0afa21..061420037 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -11,6 +11,7 @@ using Tango.Logging;
using Tango.MachineStudio.Common;
using Tango.MachineStudio.Common.Authentication;
using Tango.MachineStudio.Common.Modules;
+using Tango.MachineStudio.Common.Navigation;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.Common.StudioApplication;
using Tango.MachineStudio.UI.SupervisingController;
@@ -24,6 +25,7 @@ namespace Tango.MachineStudio.UI.ViewModels
public class MainViewVM : ViewModel<IMainView>
{
private IStudioModule _currentModule;
+ private INavigationManager _navigation;
private bool _isDisconnecting;
public IStudioModule CurrentModule
@@ -57,6 +59,8 @@ namespace Tango.MachineStudio.UI.ViewModels
public RelayCommand DisconnectCommand { get; set; }
+ public RelayCommand SignoutCommand { get; set; }
+
private IAuthenticationProvider _authenticationProvider;
public IAuthenticationProvider AuthenticationProvider
{
@@ -95,8 +99,10 @@ namespace Tango.MachineStudio.UI.ViewModels
IAuthenticationProvider authenticationProvider,
IStudioModuleLoader studioModuleLoader,
INotificationProvider notificationProvider,
- IStudioApplicationManager applicationManager) : base(view)
+ IStudioApplicationManager applicationManager,
+ INavigationManager navigationManager) : base(view)
{
+ _navigation = navigationManager;
AuthenticationProvider = authenticationProvider;
StudioModuleLoader = studioModuleLoader;
NotificationProvider = notificationProvider;
@@ -106,7 +112,8 @@ namespace Tango.MachineStudio.UI.ViewModels
HomeCommand = new RelayCommand(Home);
ConnectCommand = new RelayCommand(ConnectToMachine);
- DisconnectCommand = new RelayCommand(DisconnectFromMachine,(x) => ApplicationManager.IsMachineConnected && !_isDisconnecting);
+ SignoutCommand = new RelayCommand(SignOut);
+ DisconnectCommand = new RelayCommand(DisconnectFromMachine, (x) => ApplicationManager.IsMachineConnected && !_isDisconnecting);
}
private async void DisconnectFromMachine()
@@ -122,13 +129,21 @@ namespace Tango.MachineStudio.UI.ViewModels
}
}
+ private void SignOut()
+ {
+ _authenticationProvider.Logout();
+ _navigation.NavigateTo(NavigationView.LoginView);
+ CurrentModule = null;
+ IsMenuOpened = false;
+ }
+
private void ConnectToMachine()
{
_notificationProvider.ShowModalDialog<MachineConnectionViewVM>((x) =>
{
if (x.SelectedMachine != null)
{
- _notificationProvider.ShowModalDialog<MachineLoginViewVM>(async (login) =>
+ _notificationProvider.ShowModalDialog<MachineLoginViewVM>(async (login) =>
{
using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.SerialNumber + "..."))
{