public void OpenSearch() { RadInputPrompt.Show(iFixit.International.Translation.Search , closedHandler: (args) => { if (!string.IsNullOrEmpty(args.Text)) { var searchTerm = args.Text; DoSearch(searchTerm); } } , keyDownHandler: (keyArgs) => { if (keyArgs.Key == Key.Enter) { RadInputPrompt.Close(0); } //if (keyArgs.Key == Key.Space) //{ // RadInputPrompt.Close(1); //} } , vibrate: false ); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { MenuItem selectedCtx = (MenuItem)sender; FavoriteScheduleViewModel favSchedView = (sender as MenuItem).DataContext as FavoriteScheduleViewModel; if (selectedCtx.Name.Equals("menuRename")) { ControlTemplate imageTemplate = (ControlTemplate)this.Resources["InputPrompt"]; //RadInputPrompt.Show(imageTemplate, "Title", new string[] { "yes", "no" }); RadInputPrompt.Show(imageTemplate, APPCONTEXT.scheduleListPromptTitle, new string[] { "save", "cancel" }, APPCONTEXT.scheduleListPromptMessage, closedHandler: (args) => { string value = args.Text; int buttonIndex = args.ButtonIndex; if (buttonIndex == 0) { updateFavoriteShceduleName(favSchedView, value); createFavoriteScheduleList(); populateFavoriteSchedule(); RadMessageBox.ShowAsync("There you go :)", MessageBoxButtons.OK, "Your favorite shedule is updated successfully."); } }); } else { removeFavoriteSchedule(favSchedView); createFavoriteScheduleList(); populateFavoriteSchedule(); RadMessageBox.ShowAsync("There you go :)", MessageBoxButtons.OK, "Shedule is removed from your favorites."); } }
public async Task <string> GetString(string title, string message) { var args = await RadInputPrompt.ShowAsync(title, MessageBoxButtons.OKCancel, message, vibrate : false); if (args.Result == DialogResult.Cancel || string.IsNullOrEmpty(args.Text)) { return(null); } return(args.Text); }
async Task AddTag() { RadInputPrompt.Show("New tag", message: "Enter the name for the new tag", buttons: MessageBoxButtons.OKCancel, closedHandler: async(args) => { if (args.Result == DialogResult.OK) { await AddTag(args.Text); } }); }
private async void UseCodeButton_Click(object sender, RoutedEventArgs e) { string code = null; InputPromptClosedEventArgs args = await RadInputPrompt.ShowAsync(AppResources.EnterCodeTitle, vibrate : false); code = args.Text; if (code == null) { return; } byte[] byteCode; try { byteCode = Convert.FromBase64String(code); } catch (Exception) { MessageBox.Show(AppResources.InvalidCodeText); return; } string dataString = Convert.ToBase64String(DeviceExtendedProperties.GetValue("DeviceUniqueId") as byte[]) + "_noads_premium"; // Create byte arrays to hold original, encrypted, and decrypted data. UTF8Encoding ByteConverter = new UTF8Encoding(); byte[] originalData = ByteConverter.GetBytes(dataString); RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider(2048); Stream src = Application.GetResourceStream(new Uri("Assets/VBA8publicKey.xml", UriKind.Relative)).Stream; using (StreamReader sr = new StreamReader(src)) { string text = sr.ReadToEnd(); RSAalg.FromXmlString(text); } RSAParameters Key = RSAalg.ExportParameters(false); if (VerifySignedHash(originalData, byteCode, Key)) { App.metroSettings.PromotionCode = code; MessageBox.Show(AppResources.ValidCodeText); } else { MessageBox.Show(AppResources.InvalidCodeText); } }
private void ApplicationBarIconButton_Click(object sender, EventArgs e) { ControlTemplate imageTemplate = (ControlTemplate)this.Resources["ImageTemplate"]; //RadInputPrompt.Show(imageTemplate, "Title", new string[] { "yes", "no" }); RadInputPrompt.Show(imageTemplate, APPCONTEXT.scheduleListPromptTitle, new string[] { "save", "cancel" }, APPCONTEXT.scheduleListPromptMessage, closedHandler: (args) => { string value = args.Text; int buttonIndex = args.ButtonIndex; if (buttonIndex == 0) { logFavoriteSchedule(value); RadMessageBox.ShowAsync("Yeey!", MessageBoxButtons.OK, "Schedule is added to the favorites."); } }); }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (isonline() == 0) { MessageBox.Show("This features requires internet connection", "Internet Required", MessageBoxButton.OK); } else { if (!IsolatedStorageSettings.ApplicationSettings.Contains("settings")) { NavigationService.Navigate(new Uri("/setting.xaml", UriKind.Relative)); } else { Style usernameStyle = new System.Windows.Style(typeof(RadTextBox)); usernameStyle.Setters.Add(new Setter(RadTextBox.WatermarkProperty, "UserName")); usernameStyle.Setters.Add(new Setter(RadTextBox.HeaderProperty, "UserName")); Style accessCode = new System.Windows.Style(typeof(RadTextBox)); accessCode.Setters.Add(new Setter(RadTextBox.HeaderProperty, "Access Code")); accessCode.Setters.Add(new Setter(RadTextBox.WatermarkProperty, "Access Code")); InputPromptSettings settings = new InputPromptSettings(); settings.Field1Mode = InputMode.Text; settings.Field1Style = usernameStyle; settings.Field3Mode = InputMode.Text; settings.Field3Style = accessCode; pop_is_open = true; RadInputPrompt.Show(settings, "Enter Information", closedHandler: (args) => { this.username = args.Text; this.accesscode = args.Text3; pop_is_open = false; if (username != null || accesscode != null) { ServerValidate1(); } }); } } //NavigationService.Navigate(new Uri("/TrackMeDown.xaml", UriKind.RelativeOrAbsolute)); }
private async void setAlert_Click(object sender, RoutedEventArgs e) { InputPromptSettings ips = new InputPromptSettings(); Style usernameStyle = new System.Windows.Style(typeof(TextBox)); usernameStyle.Setters.Add(new Setter(TextBox.InputScopeProperty, "Number")); ips.Field1Mode = InputMode.Text; string messageTitle = "Count Limit!"; string message = "Enter the No.of repetitions at which you want to get alerted"; if (GlobalValues.alertCount > 0 || settings.Contains("alertCount")) { //MessageBox.Show("There is a AlertCountValue"); //Checking IT! string valu = string.Empty; if (GlobalValues.alertCount > 0) { valu = GlobalValues.alertCount.ToString(); } else { try { valu = ((string)settings["alertCount"]); } catch { } } usernameStyle.Setters.Add(new Setter(RadTextBox.TextProperty, valu)); } else { } ips.Field1Style = usernameStyle; InputPromptClosedEventArgs args = await RadInputPrompt.ShowAsync(ips, messageTitle, MessageBoxButtons.OKCancel, message); if (args.Result == DialogResult.OK) { try { GlobalValues.alertCount = Convert.ToInt32(args.Text); } catch { } } }
private void broadcast_Click(object sender, RoutedEventArgs e) { if (onlinemode) { broadcast.Content = "Share my speed"; buttonSpeedSms.Visibility = System.Windows.Visibility.Collapsed; onlinemode = false; } else { if (isonline() == 0) { MessageBox.Show("This features requires internet connection", "Internet Required", MessageBoxButton.OK); } else { Style usernameStyle = new System.Windows.Style(typeof(RadTextBox)); Style passwordStyle = new System.Windows.Style(typeof(RadPasswordBox)); string user, pass; try { user = IsolatedStorageSettings.ApplicationSettings["signup_username"].ToString(); usernameStyle.Setters.Add(new Setter(RadTextBox.TextProperty, user)); } catch { usernameStyle.Setters.Add(new Setter(RadTextBox.WatermarkProperty, "User Name")); } try { pass = IsolatedStorageSettings.ApplicationSettings["signup_pass"].ToString(); passwordStyle.Setters.Add(new Setter(RadPasswordBox.PasswordProperty, pass)); } catch { passwordStyle.Setters.Add(new Setter(RadPasswordBox.WatermarkProperty, "Password")); } usernameStyle.Setters.Add(new Setter(RadTextBox.HeaderProperty, "User Name")); passwordStyle.Setters.Add(new Setter(RadPasswordBox.HeaderProperty, "Password")); Style accessCode = new System.Windows.Style(typeof(RadTextBox)); accessCode.Setters.Add(new Setter(RadTextBox.HeaderProperty, "Access Code")); accessCode.Setters.Add(new Setter(RadTextBox.WatermarkProperty, "Access Code")); InputPromptSettings settings = new InputPromptSettings(); settings.Field1Mode = InputMode.Text; settings.Field1Style = usernameStyle; settings.Field2Mode = InputMode.Password; settings.Field2Style = passwordStyle; settings.Field3Mode = InputMode.Text; settings.Field3Style = accessCode; RadInputPrompt.Show(settings, "Login", closedHandler: (args) => { this.username = args.Text; this.password = args.Text2; this.accesscode = args.Text3; if (username != null || password != null) { ServerValidate(); } }); } } }