private async void LockedClick(object sender, KeyRoutedEventArgs e) { if (e.Key != VirtualKey.Accept && e.Key != VirtualKey.Enter) { return; } e.Handled = true; Account account = AccountManager.GetAccount(); if (account == null) { await SDKServiceLocator.Get <IAuthHelper>().StartLoginFlowAsync(); } else if (AuthStorageHelper.ValidatePincode(Passcode.Password)) { PincodeManager.Unlock(); if (Frame.CanGoBack) { Frame.GoBack(); } else { Frame.Navigate(SDKManager.RootApplicationPage); } } else { if (RetryCounter <= 1) { await SDKManager.GlobalClientManager.Logout(); } RetryCounter--; ContentFooter.Text = String.Format(LocalizedStrings.GetString("passcode_incorrect"), RetryCounter); ContentFooter.Visibility = Visibility.Visible; } }