views:

448

answers:

0

Hi, here's more or less what I have in my XAML:

<Grid x:Name="LayoutRoot">
 <common:HierarchicalDataTemplate ItemsSource="{Binding RangeValuesDefinition}" ItemContainerStyle="{StaticResource CustomTreeItem}">
  <common:HierarchicalDataTemplate.ItemTemplate>
    <common:HierarchicalDataTemplate>
      <Border BorderBrush="#FF464646" BorderThickness="1" CornerRadius="3" Padding="5">
       <Grid>
        <Grid.RowDefinitions>
         <RowDefinition />
         <RowDefinition />
         <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
         <ColumnDefinition Width="Auto"/>
         <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="0">
         <TextBox  Text="{Binding Value, Converter={StaticResource NumberConverter}, Mode=TwoWay}" Background="#FF787878" Margin="5,0,0,0" theming:ImplicitStyleManager.ApplyMode="Auto"/>
        </StackPanel>
        <StackPanel Grid.ColumnSpan="2" Grid.Row="2">
         <ItemsControl ItemsSource="{Binding RangeValues, Mode=TwoWay}" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch">
          <ItemsControl.ItemsPanel>
           <ItemsPanelTemplate>
            <StackPanel Background="Transparent"/>
           </ItemsPanelTemplate>
          </ItemsControl.ItemsPanel>
          <ItemsControl.ItemTemplate>
           <DataTemplate>
            <Grid Margin="0,2,0,0">
             <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"></ColumnDefinition>
              <ColumnDefinition Width="*"></ColumnDefinition>
             </Grid.ColumnDefinitions>
             <StackPanel Orientation="Vertical">
              <StackPanel Orientation="Horizontal" Margin="1,5,0,0" HorizontalAlignment="Left">
               <StackPanel x:Name="NumericPanel" Orientation="Horizontal" Visibility="Collapsed">
                <TextBlock Margin="5,0,5,0" Foreground="#949494"><Run Text="Minimum:   "/></TextBlock>
                <TextBox Width="90" Background="#FF787878" FontSize="10" Text="{Binding Minimum, Converter={StaticResource NumberConverter}, Mode=TwoWay}"    theming:ImplicitStyleManager.ApplyMode="Auto"/>                            </StackPanel>
              </StackPanel>
             </StackPanel>
            </Grid>
           </DataTemplate>
          </ItemsControl.ItemTemplate>
         </ItemsControl>
        </StackPanel>
       </Grid>
      </Border>
     </common:HierarchicalDataTemplate>
    </common:HierarchicalDataTemplate.ItemTemplate>
   </common:HierarchicalDataTemplate>
  </Grid>

Now, when I try to move from the first textbox (Binding Value) to the one in my inner grid (Binding Minimum) with Tab, the focus gets lost, it doesn't reach the controls inside that grid and I'm not sure why, it acts pretty weird.

Any clue?

Thanks in advance!