title: WPF: How to select parent listbox if user clicked on child listbox
body: <p>In my application using DataTemplate mechanism I insert into ListBox item another listbox. But is it possible that when selected one listboxitem in parent listbox, the focus may be on another parent listboxitem's child (see picture)</p>
  
  <p><a href="https://i.stack.imgur.com/Fxf2n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fxf2n.png" alt="Pic"></a>
  </p>
  
  <p>How to do: if one of child listbox in focus (one item from them selected), then parent listboxitem being selected to? Using binding or templating</p>
  
  <pre><code>&lt;DataTemplate x:Key="NotesListBoxDataTemplate" DataType="Note"&gt;
      &lt;StackPanel Orientation="Vertical"&gt;
  
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;TextBox Text="{Binding Path=Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"&gt;&lt;/TextBox&gt;
              &lt;my:DatePicker Height="25" Name="datePicker1" Width="115" xmlns:my="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" 
                             SelectedDate="{Binding LastEdit,
                                                    Mode = TwoWay}" /&gt;
          &lt;/StackPanel&gt;
          &lt;TextBox Text="{Binding Path=Content, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"&gt;&lt;/TextBox&gt;
  
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;ListBox Name="ImagesListBox"  SelectedIndex="{Binding Mode=OneWayToSource, Source={StaticResource progParameters}, Path=SelectedImage, UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding Path=Images}" ItemTemplate="{StaticResource NotesListBoxImagesTemplate}" Style="{StaticResource HorizontalListBox}"&gt;
              &lt;/ListBox&gt;
              &lt;StackPanel Orientation="Vertical"&gt;
                  &lt;Button Name="AddImageButon" Content="+" Click="AddImageButon_Click"&gt;&lt;/Button&gt;
                  &lt;Button Name="RemoveImageButon" Content="-" Click="RemoveImageButon_Click"&gt;&lt;/Button&gt;
              &lt;/StackPanel&gt;
  
          &lt;/StackPanel&gt;
  
      &lt;/StackPanel&gt;
  &lt;/DataTemplate&gt;
  </code></pre>