THE SOFTWARE INPUT PANEL (SIP)

In this section, you'll take a closer look at how users enter text into text boxes in Windows Phone 7 applications. You've seen the keyboard entry several times already (for example, see Figure 7-9, earlier in this chapter). This keyboard entry display is known as the SIP.

Several methods of input are available in most mobile devices, including, in some cases, voice recognition. However, alphanumeric input is perhaps the most prevalent. Depending on what a text box is intended to contain, though, you might want to have a little more control over a user's input. For example, if the user is entering a phone number, letters are not required. In this case, you might want to display only a numeric keypad.

There is no way of completely customizing the SIP with your own selection of letters, numbers, and symbols. Thankfully, though, you can have the SIP display in various modes that restrict or enhance user input capabilities in a more generic (but no less useful) way.

Controlling the SIP

The SIP is controlled by the InputScope property of a text box. In XAML, you can set this property with a string value that is the name of a member of the InputScopeNameValue enumeration. This is quite a large enumeration; it has 62 members. However, not every member has a unique associated SIP display.

If you don't set the InputScope property, the value is assumed to be Default, which gives a basic alphanumeric keypad. For example, setting it to TelephoneNumber gives the ...

Get Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.