From 11a0223d33077bbca56d944c9f54d32423a05d7a Mon Sep 17 00:00:00 2001 From: Victor Korzunin Date: Sun, 8 Apr 2018 18:14:03 +0300 Subject: [PATCH] Implemented back button in the login view --- .../ViewModel/CrmLoginViewModel.cs | 8 ++++++++ Source/TimesheetParser/View/CrmLoginPage.xaml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/Source/TimesheetParser.Business/ViewModel/CrmLoginViewModel.cs b/Source/TimesheetParser.Business/ViewModel/CrmLoginViewModel.cs index 53cb502..0815689 100644 --- a/Source/TimesheetParser.Business/ViewModel/CrmLoginViewModel.cs +++ b/Source/TimesheetParser.Business/ViewModel/CrmLoginViewModel.cs @@ -15,6 +15,7 @@ public CrmLoginViewModel(IPortableNavigationService navigationService) this.navigationService = navigationService; LoginCommand = new RelayCommand(LoginCommand_Executed, () => !string.IsNullOrWhiteSpace(Login) && !string.IsNullOrEmpty(Password)); + BackCommand = new RelayCommand(BackCommand_Executed); } public string Login @@ -40,6 +41,8 @@ public string Password } public ICommand LoginCommand { get; set; } + public ICommand BackCommand { get; set; } + public CrmPluginViewModel SourcePlugin { private get; set; } private void LoginCommand_Executed() @@ -48,5 +51,10 @@ private void LoginCommand_Executed() navigationService.NavigateTo(Location.Main); } + + private void BackCommand_Executed() + { + navigationService.NavigateTo(Location.Main); + } } } \ No newline at end of file diff --git a/Source/TimesheetParser/View/CrmLoginPage.xaml b/Source/TimesheetParser/View/CrmLoginPage.xaml index b83e2ce..eaae30a 100644 --- a/Source/TimesheetParser/View/CrmLoginPage.xaml +++ b/Source/TimesheetParser/View/CrmLoginPage.xaml @@ -21,6 +21,9 @@ + + + Login: