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.
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.
Is there a way to extend this to work with ItemContainer and Itemtemplates with TextBoxes in them?