The Imaginative Universal

Studies in Virtual Phenomenology -- @jamesashley

WP7 InputScope

July 06
by James Ashley 6. July 2010 22:35

qwerty

In Windows Phone development, InputScope is a property that can be attached to a TextBox control.  It is also one of the most convenient features of Silverlight for Windows Phone.

On a phone device, we cannot depend on having a keyboard to enter text in our applications.  The InputScope attached property provides a way to automatically associate a digital touch-aware keyboard to textboxes in our application.  The syntax, moreover, is extremely simple.  To create a keyboard like that shown above, all you have to do is set a value for the InputScope property like this:

<TextBox Name="myTextBox" InputScope="Text"/>

when the TextBox receives focus, the visual keyboard automatically pops up.  When focus leaves the TextBox, the keyboard will hide itself.  Additionally, the “Text” input scope has predictive text completion built in.  If you begin typing “R-I-G” and the InputScope is set to “Text”, the visual keyboard will make some suggestions on how to complete your word.

qwerty2

I showed the short syntax for the InputScope above.  In the Blend 4 RC, the xaml parser in design mode marks the short syntax as invalid (though it will still compile).  The longer syntax for setting the Input Scope looks like this:

<TextBox x:Name="myTextBox">
    <TextBox.InputScope>
        <InputScope>
            <InputScopeName NameValue="Text"/>
        </InputScope>
    </TextBox.InputScope>
</TextBox>

I am currently still using the Windows Phone April CTP Refresh, in which not all of the Input Scope implementations are complete.  Hopefully in the next drop I will be able to show more examples of the various Input Scope keyboard designs.

Using the long syntax above will allow intellisense support to provide a listing of all the input scope values that can be entered for the InputScopeNameValue.  You list out these values programmatically by using a little reflection (the Enum class in Windows Phone is a bit different than the regular C# enum class, so GetNames isn’t available):

var inputScopes = new List<string>();

FieldInfo[] array = typeof(InputScopeNameValue).GetFields(
        BindingFlags.Public | BindingFlags.Static);
foreach (FieldInfo fi in array)
{
    inputScopes.Add(fi.Name);
}

this.DataContext = inputScopes;

A simple app can be written to try out the different input scope keyboards as they become available.  If you use the code above to set the data context on your page, the following xaml should provide a select list for experimenting with different visual keyboards:

<StackPanel>
            <TextBox x:Name="myTextBox" 
        InputScope="{Binding ElementName=lbInputScopes
    ,Path=SelectedItem}"/>
<ListBox x:Name="lbInputScopes" 
            ItemsSource="{Binding}" 
            Height="500" />
</StackPanel>

Here is the full list of InputScopes that are expected to be supported, based on the current enum names for InputScopeNameValue:

1. AddressCity
2. AddressCountryName
3. AddressCountryShortName
4. AddressStateOrProvince
5. AddressStreet
6. AlphanumericFullWidth
7. AlphanumericHalfWidth
8. ApplicationEnd
9. Bopomofo
10. Chat
11. CurrencyAmount
12. CurrencyAmountAndSymbol
13. CurrencyChinese
14. Date
15. DateDay
16. DateDayName
17. DateMonth
18. DateMonthName
19. DateYear
20. Default
21. Digits
22. EmailNameOrAddress
23. EmailSmtpAddress
24. EmailUserName
25. EnumString
26. FileName
27. FullFilePath
28. Hanja
29. Hiragana
30. KatakanaFullWidth
31. KatakanaHalfWidth
32. LogOnName
33. Maps
34. NameOrPhoneNumber
35. Number
36. NumberFullWidth
37. OneChar
38. Password
39. PersonalFullName
40. PersonalGivenName
41. PersonalMiddleName
42. PersonalNamePrefix
43. PersonalNameSuffix
44. PersonalSurname
45. PhraseList
46. PostalAddress
47. PostalCode
48. Private
49. RegularExpression
50. Search
51. Srgs
52. TelephoneAreaCode
53. TelephoneCountryCode
54. TelephoneLocalNumber
55. TelephoneNumber
56. Text
57. Time
58. TimeHour
59. TimeMinorSec
60. Url
61. Xml
62. Yomi

Tags: , ,

Silverlight | Windows Phone

Comments

9/21/2010 5:29:26 PM #

pingback

Pingback from wpseven.de

Use InputScope to give tour users a Better Experience : wpseven | Windows Phone 7 | WP7

wpseven.de

12/19/2010 8:45:39 AM #

boiler installation

The item lost me, in the 3rd comment of WP7 InputScope. I reckon I get what you are suggesting. I recognise what you are stating, but you should admit that you will find some opposite types on the globe who may perhaps not agree with you.  I'm unequivocal and unpretentious, that way everybody experiences what I mean.

boiler installation United Kingdom

1/3/2011 12:00:06 PM #

Jigar Mehta

For me, following line did not work correctly (List box was not getting bound to list)
this.DataContext = inputScopes;

Instead, I did following and it was fine.
lbInputScopes.ItemsSource = inputScopes;

Thanks.

Jigar Mehta United States

1/16/2011 3:54:01 PM #

pingback

Pingback from surex.wordpress.com

WP7 – TextBox.InputScope « Surex's developer blog

surex.wordpress.com

2/11/2011 6:59:10 AM #

gabblet

Thanks for posting this. i really had good time reading this.

gabblet United States

2/28/2011 9:55:28 AM #

Flex Development ninja

Thanks for taking time and describing the InputScope stuff, has been useful to me =)

Flex Development ninja United States

2/28/2011 9:56:42 AM #

Flex Development ninja

Thanks for taking your time and describing the stuff so thoroughly - has been useful to me.

Flex Development ninja United States

6/7/2011 11:16:43 PM #

WP7 Dev

Have new input scopes been added in the latest api?

WP7 Dev United States

6/8/2011 5:30:52 AM #

Pandora Charms

The item lost me, in the 3rd comment of WP7 InputScope. I reckon I get what you are suggesting. I recognise what you are stating, but you should admit that you will find some opposite types on the globe who may perhaps not agree with you.

Pandora Charms United States

6/10/2011 4:24:52 AM #

meizitang

New Version Meizitang slimming tablets

Meizitang Herbal Slimming Capsules

Mechanism of Action of this New Version Meizitang slimming tablets:

Accelerating the fat metabolism and reducing fat accumulation. Eliminating free radical in body and delaying skins turning senile by antioxidant.

Features:
1) Extracted from plants, thus it is without any toxicity, could be used safely
2) It works as long as you take it and it' s very easy to take, just 1 capsule/ time/ day
3)Meizitang is processed by GMP producer, complying with sanitation standards, could be taken without worry
4) We can produce it according to customers' requests or OEM procedure
5) No diarrhoea, no rebounding, reduces redundant fat but not water
6) Soft capsule, fast to absorb

New Version Meizitang slimming tablets Applicable For: people over 18 or under 60 years

New Version Meizitang slimming tablets Specification: 650mgx36pills

Usage & Dosage: 1time/day, 1capsule/time, with or without breakfast

Storage: Store in airproof, cool, and dry conditions

Standard Compliance: Q/KL2004-03

Approval Code: YWSZZ [2007] No.530100-002310

From best Meizitang New Version Manufacturers & Meizitang New Version Suppliers Directory
http://yemade.com

meizitang People's Republic of China

6/10/2011 4:25:12 AM #

poerkan

YING DA WANG REVIEW
* One of most popular China Natural Sex PIlls for men& women in AU/USA/Middle East etc!
* Giving you Rock Hard Erections Every Time
* Increase your sex drive, control, stamina and sperm count!
* Increase confidence!
* Happy partner!          
[YING DA WANG EFFECTS]
MEN: Frequent Erections, makes penis bigger and thicker, prolongs coition time (by up to 75 minutes), boosts sex drive.
WOMEN: Useful to increase secretion of vagina, improve sex desire. After taking this product woman's vagina will began to suck and shrink and women reach orgasm faster.
[YING DA WANG INGREDIENTS]
Chinese Herbal Aphrodisiac - 100% Natural and Safe Alternative - tablets adopt suoyang, xianmao, niugi, hyssop, angelica, medlar, tusizi, bugudzi and some other - rare herbal medicines which are used to nourish kidney, steadying germ cell, stimulating ardour.
[YING DA WANG INDICATIONS]
Natural Sex Pill For treatment of Erectional Dysfunction (ED), premature ejaculation, low potency, lack of sex drive or sex desire. Also useful as a recreational sex enhancement = penis enlargement or vagina tune-up pills.
[YING DA WANG USAGE & DOSAGE]
Take 1 tablet and swallow with a bit of warm water before sexual intercourse.
For a better effect the tablet can be chewed on or taken on empty stomach
[VALIDITY]: 3years
[STORAGE]: Seal, moisture-proof, in a dry place
[NOTE]
1. Cant be impatient for quick result and overtake this product.
2. Drink some cool water if you suffer from frequent erection or too long erection.
3. Dont take more than 1 pill within 24 hours
[WARNING]!
Do not take erection herbal pills if you are pregnant, breast feeding, or under the age of 18.
Please consult with a physician before taking this product.
[YING DA WANG SIDE EFFECT]: the best result, and a little headache, take 1 pills per time is enough.
Purchase male enhancement pills: Our website offer hundreds of herbal natural male enhancement pills.
http://www.poerkan.com

poerkan People's Republic of China

6/21/2011 12:30:33 PM #

pingback

Pingback from chaokuaidi.com

超快递 beta版 » Windows Phone 7 资源汇总(超全)

chaokuaidi.com

6/23/2011 3:56:50 AM #

meizitang

Really achieved?

meizitang United States

6/28/2011 7:56:13 AM #

meizitang

Meizitang botanical slimming soft gel for sale
1.Meizitang zisu slimming pill meizitang for sale
Lose 20-30 lbs per month 100% herbal and safe
350mg x 30 capsules /box,

2. Meizitang strong version bottle
"MSV" on pills with laser , 650mg*36 pills

3. Meizitang New Version Meizitang slimming tablets
36 mzt soft gel for sale cheap meizitang

4. Meizitang old version weight loss
36 soft gel, meizitang slimming gel

5. Meizitang botanical slimming (Blue Capsule)
Weight loss 30 Ibs monthly.Meizitang OEM

meizitang United States

7/4/2011 12:10:40 AM #

Penis Advantage

This should be better if you mention the methods behind your research.

Penis Advantage United States

7/13/2011 2:41:11 AM #

real estate bangalore

I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.Your place is valueble for me. Thanks!

real estate bangalore United States

7/13/2011 2:45:30 AM #

SJR Group projects

It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks

SJR Group projects United States

7/15/2011 3:53:28 AM #

Virectin

Thanks For providing such a good information.I like Your ideas and i will imply this idea in my website

Virectin United States

8/16/2011 1:21:18 AM #

pingback

Pingback from wp7appexplorer.com

WP7 App Explorer  » Dev Resources

wp7appexplorer.com

Comments are closed