Telerik UI for Windows Phone by Progress

This topic demonstrates how to add more than one field in RadInputPrompt for Windows Phone.

If you'd like to use RadInputPrompt with more than one input field you will need to create an instance of type InputPromptSettings that will contain the settings for the input prompt fields - their visibility and custom styles, if any.

RadInputPrompt can contain up to 3 fields and each of them can be either text or password. Here's the overload of the Show method that can be used for multiple input fields:

CopyC#
public static void Show(
    InputPromptSettings settings,
    object title,
    MessageBoxButtons buttons = MessageBoxButtons.OK,
    object message = null,
    object checkBoxContent = null,
    bool isCheckBoxChecked = false,
    bool vibrate = true,
    HorizontalAlignment horizontalAlignment = HorizontalAlignment.Stretch,
    VerticalAlignment verticalAlignment = VerticalAlignment.Top,
    Action<InputPromptClosedEventArgs> closedHandler = null,
    Action<KeyEventArgs> keyDownHandler = null)

Here's how you can show and input prompt with multiple fields and gets the input information when the prompt is closed:

CopyC#
InputPromptSettings settings = new InputPromptSettings();
settings.Field1Mode = InputMode.Text;
settings.Field2Mode = InputMode.Password;
settings.Field3Mode = InputMode.Password;
RadInputPrompt.Show(settings, "enter credentials", closedHandler: (args) =>
    {
        this.Username = args.Text;
        this.Password = args.Text2;
        this.PasswordConfirmation = args.Text3;
    });
Note

In order to use RadInputPrompt for Windows Phone with multiple fields, you need to make sure that at least one of the Fields is visible. To make a field visible, you need to set its type, for example:

CopyC#
settings.Field1Mode = InputMode.Text;
Note

In RadInputPrompt for Windows Phone 8, you can use the async implementation of this method. The difference in the async implementation is that you can await the method and perform the logic that should be executed after the prompt is closed without adding a closedHandler. The actions can be based on the arguments returned by the ShowAsync method. Here is the previous example with an async call:

CopyC#
InputPromptSettings settings = new InputPromptSettings();
settings.Field1Mode = InputMode.Text;
settings.Field2Mode = InputMode.Password;
settings.Field3Mode = InputMode.Password;
InputPromptClosedEventArgs args = await RadInputPrompt.Show(settings, "enter credentials");
this.Username = args.Text;
this.Password = args.Text2;
this.PasswordConfirmation = args.Text3;