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."); } }
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 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 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(); } }); } } }