private void ConfirmClicked(object sender, KeyRoutedEventArgs e) { if (e.Key != VirtualKey.Accept && e.Key != VirtualKey.Enter) { return; } e.Handled = true; if (Passcode.Password.Equals(Options.Passcode)) { LoggingService.Log($"Pincode matched, going to {SDKManager.RootApplicationPage}", LoggingLevel.Verbose); AuthStorageHelper.StorePincode(Options.Policy, Options.Passcode); PincodeManager.Unlock(); Frame.Navigate(SDKManager.RootApplicationPage); } else { DisplayErrorFlyout(LocalizedStrings.GetString("passcode_must_match")); } }
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; } }