Example #1
0
 private void btnComment_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     InputPrompt ip = new InputPrompt();
       ip.Title = Languages.LangsRes.lblComment;
       ip.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(ip_Completed);
       ip.Show();
 }
        public override void Prompt(string message, Action<PromptResult> promptResult, string title, string okText, string cancelText, string placeholder, int textLines) {
            // TODO: multiline text
            this.Dispatch(() => {
                var yes = false;

                var input = new InputPrompt {
                    Title = title,
                    Message = message,
                    IsCancelVisible = true,
                };
                input.ActionPopUpButtons.Clear();

                var btnYes = new Button { Content = okText };
                btnYes.Click += (sender, args) => {
                    yes = true;
                    input.Hide();
                };

                var btnNo = new Button { Content = cancelText };
                btnNo.Click += (sender, args) => input.Hide();

                input.ActionPopUpButtons.Clear();
                input.ActionPopUpButtons.Add(btnYes);
                input.ActionPopUpButtons.Add(btnNo);
            
                input.Completed += (sender, args) => promptResult(new PromptResult {
                    Ok = yes,
                    Text = input.Value
                });
                input.Show();
            });
        }
 private void Add_Click(object sender, EventArgs e)
 {
     var ip = new InputPrompt();
     ip.Title = "Enter a word";
     ip.Completed += ip_Completed;
     ip.Show();
 }
Example #4
0
 /// <summary>
 /// show popup window
 /// </summary>
 public void Show()
 {
     InputPrompt fileName = new InputPrompt();
     fileName.Title = "Photo Name";
     fileName.Message = "What should we call the Photo?";
     fileName.Completed += FileNameCompleted;
     fileName.Show();
 }
Example #5
0
 private void chngSrv_Click(object sender, EventArgs e)
 {
     InputPrompt ip2 = new InputPrompt();
       ip2.Title = "Zerver address:";
       ip2.Value = NetworkAddresses.ServerAddress;
       ip2.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(ip2_Completed);
       ip2.Show();
 }
Example #6
0
 private void SearchAppBarButton_Click(object sender, EventArgs e)
 {
     var input = new InputPrompt();
     //input.Completed += input_Completed;
     input.Title = "Search";
     input.BorderThickness = new Thickness(1);
     input.IsCancelVisible = true;
     input.Completed += input_Completed;
     input.Message = "Enter any keywords";
     input.Show();
 }
		private void InputClick(object sender, RoutedEventArgs e)
		{
			var input = new InputPrompt
			{
				Title = "Basic Input",
				Message = "I'm a basic input prompt" + LongText,
			};

			input.Completed += PopUpPromptStringCompleted;

			input.Show();
		}
 public void AskForString(string message, string title, Action<string> returnString)
 {
     var input = new InputPrompt();
     input.Completed += (sender, args) =>
     {
         if(args.PopUpResult == PopUpResult.Ok)
             returnString(args.Result);
     };
     input.Title = title??string.Empty;
     input.Message = message;
     input.IsCancelVisible = true;
     input.Show();
 }
		private void InputLongMsgClick(object sender, RoutedEventArgs e)
		{
			var input = new InputPrompt
			{
				Title = "Basic Input",
				Message = LongText,
				MessageTextWrapping = TextWrapping.Wrap
			};

			input.Completed += PopUpPromptStringCompleted;

			input.Show();
		}
		private void InputNoEnterClick(object sender, RoutedEventArgs e)
		{
			var input = new InputPrompt
			{
				Title = "Enter won't submit",
				Message = "Enter key won't submit now",
				IsSubmitOnEnterKey = false
			};

			input.Completed += PopUpPromptStringCompleted;

			input.Show();
		}
Example #11
0
 public void EnterTextMessage(string title, string message, Action<string> completed)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             var input = new InputPrompt();
             input.Completed += (sender, args) =>
             {
                 if (completed != null)
                     completed(args.Result);
             };
             input.Title = title;
             input.Message = message;
             input.Show();
         });
 }
		private void InitializePrompt()
		{
			//var reuseObject = ReuseObject.IsChecked.GetValueOrDefault(false);

			if (_prompt != null)
			{
				_prompt.Completed -= PromptCompleted;
			}

			//if (!reuseObject || _prompt == null)
			{
				_prompt = new InputPrompt();
			}

			_prompt.Completed += PromptCompleted;
		}
		private void InputAdvancedClick(object sender, RoutedEventArgs e)
		{
			var input = new InputPrompt
			{
				Title = "TelephoneNum",
				Message = "I'm a message about Telephone numbers!",
				Background = _naturalBlueSolidColorBrush,
				Foreground = _aliceBlueSolidColorBrush,
				Overlay = _cornFlowerBlueSolidColorBrush,
				IsCancelVisible = true
			};

			input.Completed += PopUpPromptStringCompleted;

			input.InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.TelephoneNumber } } };
			input.Show();
		}
Example #14
0
        private void DrinkExecute()
        {
            InputPrompt prompt = new InputPrompt();
            prompt.Message = CommonStrings.AmountOfWater;
            prompt.Completed += (sender, args) =>
            {
                int result;
                int.TryParse(prompt.Value, out result);
                if (result > 0)
                {
                    Diet.DrinkWater(result);
                    InvokeInUIThread(() => WaterToday = Diet.WaterToday);
                }
            };

            prompt.Show();
        }
Example #15
0
 private void Withdrawl_Click(object sender, RoutedEventArgs e)
 {
     InputPrompt with = new InputPrompt
     {
         Title = "Amount to Withdraw",
         Message = "Format is '00.00'!",
         Background = new SolidColorBrush(Colors.Green)
     };
     with.Completed += with_Completed;
     with.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.CurrencyAmount } } };
     with.Show();
 }
Example #16
0
 // the input when the deposit button is clicked
 private void Deposit_Click(object sender, RoutedEventArgs e)
 {
     InputPrompt deposit = new InputPrompt {
         Title = "Amount to Deposit",
         Message = "Format is '00.00'!",
         Background = new SolidColorBrush(Colors.Green)
         };
     deposit.Completed += deposit_Completed;
     deposit.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.CurrencyAmount } } };
     deposit.Show();
 }
    private void ForgotPassword(object sender, RoutedEventArgs e)
    {
        InputPrompt input = new InputPrompt();
        input.Completed += input_Completed;
        input.Title = "Password Recovery";
        input.Message = "Please fill in your email to recover your password";
        
 
        input.Show();
        
    }
 /// <summary>
 /// Popup window to accept user input for image to be saved
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void buttonSave_Click(object sender, EventArgs e)
 {
     InputPrompt fileName = new InputPrompt();
     fileName.Title = "Photo Name";
     fileName.Message = "What should we call the Photo?";
     fileName.Completed += FileNameCompleted;
     fileName.Show();
 }
Example #19
0
        private void ApplicationBarIconButtonStop_Click(object sender, EventArgs e)
        {
            if (isRecording)
            {
                gcw.Stop();
                //PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled;
                isRecording = false;
                mPage.curAdmin.Text = AppResources.NotRecord;
                mPage.curCoord.Visibility = Visibility.Collapsed;
                string filename = DateTime.Now.ToString("yyMMdd_HHmmss");

                InputPrompt input = new InputPrompt();
                input.Title = AppResources.TraceName; input.Value = filename; input.IsCancelVisible = true;
                input.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(input_Completed);
                input.Show();

                //ViewModel.Items.Add(new Trace(filename, DateTime.Now, trk.Count));
            }
            else
                MessageBox.Show(AppResources.NotRecord);
        }
Example #20
0
 //offline search button function
 private void srch_Click(object sender, EventArgs e)
 {
     searchoffline = new InputPrompt();
     searchoffline.Message = "Enter the location";
     searchoffline.Completed += searchoffline_Completed;
     searchoffline.Show();
 }
        private void ApplicationBarMenuItem_AddFavorite_Click(object sender, EventArgs e)
        {
            string url = this.URLTextBox.Text;
            if (!url.StartsWith("http://") && !url.StartsWith("https://"))
            {
                url = ("http://" + url);
            }

            Uri validatedUri;
            if (!Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out validatedUri))
            {
                MessageBox.Show(NewDownload.FavoriteInvalidURL, NewDownload.FavoriteAddition, MessageBoxButton.OK);
                return;
            }

            InputPrompt input = new InputPrompt()
            {
                Title = NewDownload.FavoriteAddition
            };
            input.Completed += (lsender, le) =>
            {
                if (!string.IsNullOrEmpty(le.Result))
                {
                    this.ApplicationSettingsService.AddFavorite(new Favorite()
                    {
                        Title = le.Result,
                        Url = url
                    });
                    MessageBox.Show(NewDownload.FavoriteAdditionSuccess, NewDownload.FavoriteAddition, MessageBoxButton.OK);
                    Messenger.Default.Send<Update, FavoritesViewModel>(null);
                }
                else
                {
                    MessageBox.Show(NewDownload.FavoriteNameRequired, NewDownload.FavoriteAddition, MessageBoxButton.OK);
                }
            };
            input.Show();
        }
Example #22
0
 public void getNumberedComic()
 {
     var input = new InputPrompt
     {
         Title = "Enter Comic Number",
         Message = "Range: 0 to " + App.Current.LatestComicNum,
         BorderThickness = new Thickness(1),
         IsCancelVisible = true
     };
     input.Completed += input_Completed;
     input.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.Number} } };
     input.Show();
 }
Example #23
0
 void DisplaySavePrompt()
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         InputPrompt prompt = new InputPrompt();
         prompt.Title = "Beem";
         prompt.Message = "Enter a file name to use for the recording. MP3 extension added automatically.";
         prompt.Value = TrackName;
         prompt.IsCancelVisible = true;
         prompt.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(prompt_Completed);
         prompt.Show();
     });
 }
 /// <summary>
 /// Shows a dialog to create a new group
 /// </summary>
 /// <returns>Name of the new group if created else an empty string</returns>
 public static void CreateNewGroupDialog(GroupViewModel groupViewModel = null, bool showInfoMsg = false)
 {
     string groupName = String.Empty;
     var input = new InputPrompt
     {
         Title = "Add Group",
         Message = "\r\nChoose a name for the new group",
         MessageTextWrapping = TextWrapping.Wrap,
         IsAppBarVisible = true,
         IsCancelVisible = true,
         IsSubmitOnEnterKey = true,
         IsOverlayApplied = true
     };
     input.Completed += delegate(object sender, PopUpEventArgs<string, PopUpResult> e)
     {
         if (e.PopUpResult == PopUpResult.Ok)
         {
             groupName = e.Result;
             if (groupViewModel == null)
                 groupViewModel = new GroupViewModel();
             groupViewModel.Group.Name = groupName;
             if (groupViewModel.Create())
             {
                 groupViewModel.AllGroups.Add(groupViewModel.Group);
                 if (showInfoMsg)
                     MessageBox.Show("Group is created but won't be shown here!\r\nAdd some medicines to the group to see it here.");
             }
         }
     };
     input.Show();
 }
Example #25
0
 //offline navigation function
 private void route_Click(object sender, EventArgs e)
 {
     searchloc = new InputPrompt();
     searchloc.Message = "Enter the location";
     searchloc.Completed += searchloc_Completed;
     searchloc.Show();
 }
 /// <summary>
 /// Shows the edit group dialog, where user can change the name
 /// </summary>
 private void EditGroupButton_Click(object sender, RoutedEventArgs e)
 {
     var groupName = ((Button)sender).Tag.ToString();
     var input = new InputPrompt
     {
         Title = "Edit Group Name",
         Message = String.Format("\r\nChoose a new name for the group, \"{0}\"", groupName),
         MessageTextWrapping = TextWrapping.Wrap,
         IsAppBarVisible = true,
         IsCancelVisible = true,
         IsSubmitOnEnterKey = true,
         IsOverlayApplied = true
     };
     input.Completed += delegate(object sender1, PopUpEventArgs<string, PopUpResult> e1)
     {
         GroupViewModel groupViewModel;
         if (e1.PopUpResult == PopUpResult.Ok)
         {
             groupViewModel = new GroupViewModel(groupName);
             groupViewModel.Group.Name = e1.Result;
             groupViewModel.Save();
             App.ViewModel.LoadAllMedicinesByGroups(true);
         }
     };
     input.Show();
 }
Example #27
0
        void recordAudioAppBar_Click(object sender, EventArgs e)
        {
            InputPrompt filename = new InputPrompt();

            filename.Title = "Sound Name";
            filename.Message = "What should we call the sound?";

            filename.Completed += filename_Completed;

            filename.Show();
        }
Example #28
0
 private void ScrollViewer_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     ip = new InputPrompt();
       ip.Title = Languages.LangsRes.lblComment;
       ip.Value = textPrevBox.Text;
       ip.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(ip_Completed);
       ip.Show();
 }
Example #29
0
        void recordAudioAppBar_Click(object sender, EventArgs e)
        {
            string text_entered = "test";
            //MessageBox.Show("clicked on record audio app bar");
            MessageBox.Show("About to play the temporary recorded file");
            AudioPlayer.Play();
            MessageBox.Show("done playing");
            InputPrompt fileName = new InputPrompt();
            fileName.Background = new SolidColorBrush(Colors.Blue);
            fileName.Title = "Input title";
            fileName.Message = "Give a title for your note";
            fileName.Completed += fileName_Completed;
            fileName.Show();



          
        }