Tutorial of the Day 4: Tips on Debugging WP7 Application(Frame Rate Counters)

When you try to depoly the WP7 Application to your phone or emulator via Visual Studio, it is not difficult for you to find some numbers showing at the right top corner of the application. They are Frame Rate Counters.

Continue reading

Advertisements

Tutorial of the Day3 : Input Scope of TextBox in WP7

You may have a question “how to set a textbox for inputing url” which shows the .com button when developing Windows Phone 7 Application. If you create a simple TextBox, you will find the Windows Phone always showing the default virtual keyboard.

However, you may want a textbox for user to input some common type of data, for example a Phone Number, then the letters are all useless when inputing. The user experience is not that great if you show the default one including all letters but not this one.

Cool! huh?

Here I will introduce a property in TextBox which will help you if you find the above difficulty.

The property name is “InputScope” which is an Enumeration called InputScopeNameValue.

Here I have an example to show all the available value in the InputScope.

First of all, we should have a Listbox showing all the Textbox and corresponding TextBlock(label) showing what is the inputScope set in the TextBox.

            <ListBox x:Name="InputScopeList">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding}" Width="200"/>
                            <TextBox InputScope="{Binding}" Width="200"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

Then, we should create a String List which store all memebers in the InputScopeNameValue into our List, and finally bind it to the Listbox.

            List list = new List();
            int i = 0;
            string inputscope;
            while((inputscope = Enum.GetName(typeof(InputScopeNameValue),i)) != null)
            {
                list.Add(inputscope);
                i++;
            }
            InputScopeList.ItemsSource = list;

Here, I also include the full list of the enumeration.

CurrencyAmountThe text input pattern for amount of currency.

Member name Description
AddressCity The text input pattern for a city address.
AddressCountryName The text input pattern for the name of a country/region.
AddressCountryShortName The text input pattern for the abbreviated name of a country/region.
AddressStateOrProvince The text input pattern for a state or province.
AddressStreet The text input pattern for a street address.
AlphanumericFullWidth The text input pattern for alphanumeric full-width characters.
AlphanumericHalfWidth The text input pattern for alphanumeric half-width characters.
ApplicationEnd Not supported. For internal use in Silverlight for Windows Phone.
Bopomofo The text input pattern for the Bopomofo Mandarin Chinese phonetic transcription system.
Chat The SIP layout for text messaging, which recognizes pre-defined abbreviations. Supported only in Silverlight for Windows Phone.
CurrencyAmountAndSymbol The text input pattern for amount and symbol of currency.
CurrencyChinese The text input pattern for Chinese currency.
Date The text input pattern for a calendar date.
DateDay The text input pattern for the numeric day in a calendar date.
DateDayName The text input pattern for the name of the day in a calendar date.
DateMonth The text input pattern for the numeric month in a calendar date.
DateMonthName The text input pattern for the name of the month in a calendar date.
DateYear The text input pattern for the year in a calendar date.
Default The default handling of input commands.
Digits The text input pattern for digits.
EmailNameOrAddress The SIP layout for an e-mail name or address. Supported only in Silverlight for Windows Phone.
EmailSmtpAddress The text input pattern for a Simple Mail Transfer Protocol (SMTP) email address.
EmailUserName The text input pattern for an email user name.
EnumString Not supported. For internal use in Silverlight for Windows Phone.
FileName The text input pattern for a file name.
Formula Do not use.
FullFilePath The text input pattern for the full path of a file.
Hanja The text input pattern for Hanja characters.
Hiragana The text input pattern for the Hiragana writing system.
KatakanaFullWidth The text input pattern for full-width Katakana characters.
KatakanaHalfWidth The text input pattern for half-width Katakana characters.
LogOnName The text input pattern for a log on name.
Maps The SIP layout for entering a map location. Supported only in Silverlight for Windows Phone.
NameOrPhoneNumber The SIP layout for SMS To field. Supported only in Silverlight for Windows Phone.
Number The text input pattern for a number.
NumberFullWidth The text input pattern for a full-width number.
NumericPassword Do not use.
OneChar The text input pattern for one character.
Password The text input pattern for a password.
PersonalFullName The text input pattern for a person’s full name.
PersonalGivenName The text input pattern for a person’s given name.
PersonalMiddleName The text input pattern for a person’s middle name.
PersonalNamePrefix The text input pattern for the prefix of a person’s name.
PersonalNameSuffix The text input pattern for the suffix of a person’s name.
PersonalSurname The text input pattern for a person’s surname.
PhraseList The text input pattern for a phrase list.
PostalAddress The text input pattern for a postal address.
PostalCode The text input pattern for a postal code.
Private Not supported. For internal use in Silverlight for Windows Phone.
RegularExpression The text input pattern for a regular expression.
Search The SIP layout for a search query. Supported only in Silverlight for Windows Phone.
Srgs The text input pattern for the Speech Recognition Grammar Specification (SRGS).
TelephoneAreaCode The text input pattern for a telephone area code.
TelephoneCountryCode The text input pattern for a telephone country/region code.
TelephoneLocalNumber The text input pattern for a telephone local number.
TelephoneNumber The text input pattern for a telephone number.
Text The software input panel (SIP) layout for standard text input. Supported only in Silverlight for Windows Phone.
Time The text input pattern for the time.
TimeHour The text input pattern for the hour of the time.
TimeMinorSec The text input pattern for the minutes or seconds of time.
Url The text input pattern for a Uniform Resource Locator (URL).
Xml The text input pattern for XML.
Yomi Not supported. For internal use in Silverlight for Windows Phone.

Hope you will enjoy this tutorial 🙂