InputPrompt

Overview

Basically InputPrompt is an UI component that derives from the toolkit`s abstract PopUp<T, TPopUpResult> class . As its name says it is a kind of extended popup that prompt user to enter input.


Getting Started

To begin using InputPrompt first add a reference to the Coding4Fun.Phone.Controls.dll assembly.

Creating InputPrompt:

C#:
InputPrompt input = new InputPrompt();
input.Completed += input_Completed;
input.Title = "Basic Input";
input.Message = "I'm a basic input prompt";
input.Show();

Key Features

InputPrompt exposes the following properties that can be used to customize its content:
  • InputScope
  • Value
  • Title
  • Message
  • Overlay
  • HasGesturesDisabled

NOTE: What is the HasGesturesDisabled property? : With the current Gesture Service in the Silverlight Toolkit (November 2010 release), if two controls are overlapped and the bottom control has a listener attached, events will still bubble through with no way to cancel it without putting on a listener. In a control that is called PopUp, it is self defeating to have this bubble through effect happening. If the SL toolkit corrects the behavior, we’ll remove the HasGesturesDisabled property as it would no longer be needed. This would also remove the dependency on the Silverlight Toolkit.

You can show InputPrompt using its Show() method.
When the InputPrompt popup is closed the Completed event is fired.

Example1:
InputPrompt input = new InputPrompt();
input.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(input_Completed);
input.Title = "EmailSmtpAddress";
input.Message = "I'm a message about EmailSmtpAddress!"; 
input.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.EmailSmtpAddress } } };
input.Show();



Example2:
InputPrompt input = new InputPrompt
    {
        Title = "TelephoneNum",
        Message = "I'm a message about Telephone numbers!",
        Background = new SolidColorBrush(Colors.Green),
        Overlay = new SolidColorBrush(Color.FromArgb(200, 255, 117, 24))
    };
 
    input.Completed += input_Completed;
 
    input.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.TelephoneNumber } } };
    input.Show();



Example3:
InputPrompt input = new InputPrompt();
input.Value = "Enter some text here";
input.Show();

Last edited Apr 26, 2011 at 10:24 AM by WinPhoneGeek, version 4

Comments

Paylon Mar 27 at 11:54 PM 
inputList.InputScope = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.PersonalSurname } } }; - this is the solution :)

Paylon Mar 27 at 11:51 PM 
Need help!! How can I make Shift button appear pressed when keyboard with textbox popup, so user won't need tap Shift button first before typing the text he wants to appear TitleCase? Thank you very much for any advice!

toxsedyshev Mar 4 at 12:24 AM 
Why not async/await? Why callback?

skrangan Jan 5 at 1:06 PM 
Actually I need to get value from a radio button which is in an overlay...
Is that possible? Is there any other references for that?

cbfjay Aug 11, 2013 at 2:05 PM 
How can I forbid user input the empty message? Another, how to add extra button in the Popup?

ketan_patil Jan 19, 2013 at 11:04 AM 
how can i add multiple input controls in InputPrompt??? is there any option?

FacilisDK Feb 2, 2012 at 8:47 AM 
So... How do I set the InputScope in XAML?