Tab Problem with views
I am trying to design a silverlight page using some views. I was able to get the desired UI. But am facing problem while tabbing through the page. To get the views I have coded something like this;
<Grid x:Name="LayoutRoot" Background="White">
<ItemsControl ItemsSource="{Binding }" BorderThickness="1" BorderBrush="Black">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Controls:TemplateSelectorDataTemplate FieldType="0001">
<Grid>
<!--Grid definintions-->
.
.
.
<views:Address DataContext="{Binding }" IsTabStop="True" Visibility="{Binding Path=IsWidgetVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
</Grid>
</Controls:TemplateSelectorDataTemplate>
<Controls:TemplateSelectorDataTemplate FieldType="0002">
<Grid>
<!--Grid definintions-->
.
.
.
<views:ContactSearchView DataContext="{Binding }" IsTabStop="True" Visibility="{Binding Path=IsWidgetVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
&开发者_如何学Clt;/Grid>
</Controls:TemplateSelectorDataTemplate>
<Controls:TemplateSelectorDataTemplate FieldType="0003">
<Grid>
<!--Grid definintions-->
.
.
.
<views:GroupView DataContext="{Binding }" IsTabStop="True" Visibility="{Binding Path=IsWidgetVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
</Grid>
</Controls:TemplateSelectorDataTemplate>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
The Individual views are like;
<!--AddressView-->
<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding }">
<!--Grid Definitons-->
<TextBlock x:Name="xyz"....../>
<TextBox x:Name = "xyzBox"...../>
.
.
.
.
</Grid>
<!--ContactDetails-->
<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding }">
<!--Grid Definitons-->
<custom NewDatePicker x:Name="DOB"....../>
<TextBox x:Name = "NameBox"...../>
.
.
.
.
</Grid>
The problem that I am facing is that while I am trying to tab from the end of one view to the other view, I had to press the tab twice insted of once. It is working fine once inside the View.
Take off isTabStop="True". By default it's set to true, so when you set it to true again, for some reason you have to tab twice. You would think that it shouldn't matter just to have clearer markup. The only purpose I can see for that attribute is to set it to false.
精彩评论