title: MoveFocus from one listBox to another
body: <p>I have the Output something like Windows 8 Start Menu.</p>
  
  <p>Here is screen-shot of my Output:</p>
  
  <p><img src="https://i.stack.imgur.com/gG5YB.jpg" alt="enter image description here"></p>
  
  <p>I have successfully got that output by getting help from <a href="https://stackoverflow.com/questions/22150944/which-control-will-be-more-appropriate-to-the-output-shown-below">this</a> question.</p>
  
  <p>XAML for achieving the below output:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding MenuCategories}" &gt;
  
      &lt;ItemsControl.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;StackPanel IsItemsHost="True" Orientation="Horizontal" /&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ItemsControl.ItemsPanel&gt;
  
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Grid &gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="Auto" /&gt;
                      &lt;RowDefinition Height="*" /&gt;
                  &lt;/Grid.RowDefinitions&gt;
  
                  &lt;TextBlock Text="{Binding Title}" FontSize="30" /&gt;
  
                  &lt;ListBox Grid.Row="1" x:Name="lst" ItemsSource="{Binding Design_Master_TileItem}" BorderThickness="0"
                           SelectedItem="{Binding DataContext.SelectedTile, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
                           helpers:SingleSelectionGroup.SelectionGroup="Group"&gt;
  
                      &lt;ListBox.ItemsPanel&gt;
                          &lt;ItemsPanelTemplate&gt;
                              &lt;WrapPanel IsItemsHost="True" Orientation="Vertical" MaxHeight="{Binding ElementName=lst, Path=ActualHeight}"/&gt;
                          &lt;/ItemsPanelTemplate&gt;
                      &lt;/ListBox.ItemsPanel&gt;
  
                      &lt;ListBox.Resources&gt;
                          &lt;Style TargetType="{x:Type ListBoxItem}"&gt;
                              &lt;Setter Property="Width" Value="250" /&gt;
                              &lt;Setter Property="Height" Value="125" /&gt;
                              &lt;Setter Property="Margin" Value="2.5" /&gt;
                              &lt;Setter Property="Padding" Value="2.5" /&gt;
                              &lt;Setter Property="Background" Value="{Binding Background, Converter={StaticResource stringToBrushConverter}}" /&gt;
                              &lt;Setter Property="Foreground" Value="White" /&gt;
                              &lt;Setter Property="VerticalContentAlignment" Value="Bottom" /&gt;
                              &lt;Style.Triggers&gt;
                                  &lt;Trigger Property="IsSelected" Value="True"&gt;
                                      &lt;Setter Property="Foreground" Value="{Binding Background, Converter ={StaticResource stringToBrushConverter}}" /&gt;
                                  &lt;/Trigger&gt;
                                  &lt;Trigger Property="IsKeyboardFocusWithin" Value="True"&gt;
                                      &lt;Setter Property="IsSelected" Value="True"&gt;&lt;/Setter&gt;
                                  &lt;/Trigger&gt;
                              &lt;/Style.Triggers&gt;
                          &lt;/Style&gt;
                      &lt;/ListBox.Resources&gt;
  
                      &lt;ListBox.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;StackPanel Orientation="Horizontal" Height="125" Width="250"&gt;
                                  &lt;Path Data="{Binding ImageData}"  VerticalAlignment="Center" 
                                        Stretch="Uniform" Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
                                        Width="68" Height="68" Margin="10" RenderTransformOrigin="0.5,0.5"&gt;
                                      &lt;Path.RenderTransform&gt;
                                          &lt;TransformGroup&gt;
                                              &lt;TransformGroup.Children&gt;
                                                  &lt;RotateTransform Angle="0" /&gt;
                                                  &lt;ScaleTransform ScaleX="1" ScaleY="1" /&gt;
                                              &lt;/TransformGroup.Children&gt;
                                          &lt;/TransformGroup&gt;
                                      &lt;/Path.RenderTransform&gt;
                                  &lt;/Path&gt;
                                  &lt;TextBlock Text="{Binding Title, Converter={StaticResource spaceToNewLineConverter}}" VerticalAlignment="Top" 
                                             Margin="40,10,10,10" FontSize="24" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"/&gt;
                              &lt;/StackPanel&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListBox.ItemTemplate&gt;
  
                  &lt;/ListBox&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>So, from the above code you might have understood that Group and Ledger are two items of listbox1. and other four are the items of listbox2.</p>
  
  <p><strong>Requirements:</strong></p>
  
  <p>Suppose, ItemA1 is selected in listboxA.</p>
  
  <p><em>Case1: New Behavior</em></p>
  
  <p>If ListBoxA does not have any items on the right side of Item1, then when I press right arrow key the focus should move to the ItemB1 of listboxB. Likewise if ItemA2 of listboxA is selected then the focus should move to the ItemB2 of ListBoxB.</p>
  
  <p><em>Case2: Default Behavior</em></p>
  
  <p>If ListBoxA has some items on the right hand side of ItemA1, then that item should be selected by pressing right arrow key. I have this behavior by default but I don't want to disturb it. I mean while implementing Case1 I don't want to loose the default behavior.</p>