wp7 Keyboard helper as a behavior

Thanks to a number of comments regarding the problems I had with the ApplicationBar and the keyboard I’ve decided to apply some of the ideas to my previous post (thanks everyone for the comments) about a keyboard helper to create a self contained keyboard tab helper behavior (mouthful). I’ve posted the full code and binaries, Wp7KeyboardSource.zip
but essentially all you now have to do is;

<Grid x:Name=ContentGrid Grid.Row=1>

  <i:Interaction.Behaviors>

    <keyboard:KeyboardTabHelperBehavior />

  </i:Interaction.Behaviors>

  <StackPanel Orientation=Vertical>

    <CheckBox IsTabStop=True TabIndex=4 Content=Some check/>

    <TextBox TabIndex=1 Text=start here/>

    <TextBox IsTabStop=True Text=Won’t tab here cause not set tabindex/>

    <TextBox IsEnabled=False TabIndex=2 Text=not here cause disabled/>

    <TextBox TabIndex=3 Text=next stop here/>

  </StackPanel>

</Grid>

 …and that’s it, no code behind, no adding of event handlers. Just set up your tab index and stops and it will take care of the rest.

Advertisements
This entry was posted in keyboard, Uncategorized, wp7, wp7dev. Bookmark the permalink.

4 Responses to wp7 Keyboard helper as a behavior

  1. pauliom says:

    Oooops, noticed that I’ve posted the version without the code to unattach the key event when the behavior is unattached, please make sure you add that if you’ve already taken it.

  2. Pingback: Дайджест технических материалов #5 (Windows Phone 7) - Oleksandr Krakovetskiy blog - Microsoft User Group Винница

  3. Pingback: User-Friendly Input Pages « Windows Phone 7 from the Trenches

  4. Jay Kannan says:

    Is there a way to extend this to work with ItemContainer and Itemtemplates with TextBoxes in them?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s