private void PasswordClick(object sender, RoutedEventArgs e) { var passwordInput = new PasswordInputPrompt { Title = "Basic Input", Message = "I'm a basic input prompt" + LongText, }; passwordInput.Completed += PopUpPromptStringCompleted; passwordInput.Show(); }
private void InputLongMsgClick(object sender, RoutedEventArgs e) { var passwordInput = new PasswordInputPrompt { Title = "Basic Input", Message = LongText, MessageTextWrapping = TextWrapping.Wrap, }; passwordInput.Completed += PopUpPromptStringCompleted; passwordInput.Show(); }
private void PasswordNoEnterClick(object sender, RoutedEventArgs e) { var passwordInput = new PasswordInputPrompt { Title = "Enter won't submit", Message = "Enter key won't submit now", IsSubmitOnEnterKey = false }; passwordInput.Completed += PopUpPromptStringCompleted; passwordInput.Show(); }
private void InitializePrompt() { //var reuseObject = ReuseObject.IsChecked.GetValueOrDefault(false); if (_prompt != null) { _prompt.Completed -= PromptCompleted; } //if (!reuseObject || _prompt == null) { _prompt = new PasswordInputPrompt(); } _prompt.Completed += PromptCompleted; }
private void PasswordAdvancedClick(object sender, RoutedEventArgs e) { var passwordInput = new PasswordInputPrompt { Title = "TelephoneNum", Message = "I'm a message about Telephone numbers!", Background = _naturalBlueSolidColorBrush, Foreground = _aliceBlueSolidColorBrush, Overlay = _cornFlowerBlueSolidColorBrush, IsCancelVisible = true, InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.TelephoneNumber } } }, Value = "doom" }; passwordInput.Completed += PopUpPromptStringCompleted; passwordInput.Show(); }
/// <summary> /// Occurs when click on an item in a ListBox /// </summary> private void listAllLibraries_SelectionChanged(object sender, SelectionChangedEventArgs e) { //On récupère la listbox qui a levé l'évènement ListBox lst = sender as ListBox; if (lst.SelectedIndex != -1) { //On récupère notre objet métier LibraryRootObject lib = lst.SelectedItem as LibraryRootObject; //On annule la sélection lst.SelectedIndex = -1; GlobalVariables.currentLibrary = lib.id; if (lib.encrypted == true) { SetProgressIndicator(true); //Go to ContentLibraryPage with library password passwordInputLibrary = new PasswordInputPrompt { Title = AppResources.ListLibrary_LibCrypt_PasswordInput_Title, Message = AppResources.ListLibrary_LibCrypt_PasswordInput_Message, IsCancelVisible = true, Overlay = new SolidColorBrush(Color.FromArgb(150,160,160,160)) }; passwordInputLibrary.Completed += input_Completed; passwordInputLibrary.Show(); } else { //Go to ContentLibraryPage NavigationService.Navigate(new Uri("/Pages/ContentLibraryPage.xaml?token=" + authorizationToken + "&url=" + address + "&idlibrary=" + GlobalVariables.currentLibrary, UriKind.Relative)); } } }
public static void VerifyUserAuthenticity(PhoneApplicationPage requestedPage) { if (SessionVariables.IsLoggedIn) return; var input = new PasswordInputPrompt { Title = "Password Required!", Message = "\r\nThe page you are trying to access requires a password", MessageTextWrapping = TextWrapping.Wrap, VerticalAlignment = VerticalAlignment.Center, IsAppBarVisible = true, IsSubmitOnEnterKey = true, HorizontalAlignment = HorizontalAlignment.Center, HorizontalContentAlignment = HorizontalAlignment.Center }; input.Completed += delegate(object sender, PopUpEventArgs<string, PopUpResult> e) { if (e.PopUpResult != PopUpResult.Ok) { // TODO: A better way to handle Back button close of pop up if (requestedPage.NavigationService.CanGoBack) requestedPage.NavigationService.GoBack(); else // requestedPage.NavigationService.Navigate(new Uri(ApplicationHelper.GetUrlFor(ApplicationHelper.URLs.MainPage), UriKind.Relative)); throw new UnauthorizedAccessException("User cannot access this page. Quitting the app as exit was triggered"); return; } if (e.Result.Equals(Settings.Password)) SessionVariables.IsLoggedIn = true; else { SessionVariables.IsLoggedIn = false; MessageBox.Show("Incorrect Password"); VerifyUserAuthenticity(requestedPage); } }; input.InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.NumericPassword } } }; input.Show(); }