title: How to Synchronize ListBox SelectedItem and the focused item in WPF?
body: <p>I create buttons as ListBox items. Using keyboard shortcut, the selected item/button will be changed to the button where the first character is the same with the pressed key. The problem is the focused item (dashed rectangle) will not be synchronized with selected item. This problem doesn't exist if we use keyboard arrow. The shorted code is:</p>
  
  <pre><code>        &lt;ListBox x:Name="ListBoxRef" 
               ScrollViewer.HorizontalScrollBarVisibility="Disabled"
               DataContext="{Binding Path=ListViewSource}" IsSynchronizedWithCurrentItem="True"
               ItemsSource="{Binding}"&gt;
          &lt;ItemsControl.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Button Tag="{Binding}" IsTabStop="False"
                          Command="{Binding ElementName=UserControlTypeSelectionView, Path=DataContext.SelectCommand}"
                          CommandParameter="{Binding RelativeSource={RelativeSource Self}}"&gt;
                      &lt;Button.Template&gt;
                          &lt;ControlTemplate&gt;
                              &lt;TextBlock Text="{Binding Path=Name}" /&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Button.Template&gt;
                  &lt;/Button&gt;
              &lt;/DataTemplate&gt;
          &lt;/ItemsControl.ItemTemplate&gt;
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>In <a href="https://stackoverflow.com/questions/10444518/how-do-you-programmatically-set-focus-to-the-selecteditem-in-a-wpf-listbox-that">How do you programmatically set focus to the SelectedItem in a WPF ListBox that already has focus?</a>, the solution is using the Focus method and in C# side.</p>
  
  <p><strong>Is it possible using only XAML in MVVM?</strong></p>