title: SelectionChanged Event for ListBox in panorama.ItemTemplate for Windows Phone?
body: <p>I have item template for the panorama control. In that template, i have listbox with listItem template. I have problem with selection changed event in the list box.</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage.Resources&gt;
      &lt;CollectionViewSource x:Key="SlideItemList" Filter="collectionView_Filter"/&gt;
  &lt;/phone:PhoneApplicationPage.Resources&gt;
  
  &lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
  &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
  
      &lt;!--Panorama control--&gt;
      &lt;controls:Panorama x:Name="AppPano" ItemsSource="{Binding SlidesCollections}" SelectionChanged="AppPano_SelectionChanged" &gt;
          &lt;controls:Panorama.Background&gt;
              &lt;ImageBrush ImageSource="PanoramaBackground.png"/&gt;
          &lt;/controls:Panorama.Background&gt;
  
          &lt;controls:Panorama.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,-100,0,0"&gt;
                      &lt;StackPanel HorizontalAlignment="Center" Height="250" Width="200" VerticalAlignment="Top"&gt;
                          &lt;TextBlock Text="{Binding Title}" HorizontalAlignment="Center" FontSize="200" Width="Auto"/&gt;
                      &lt;/StackPanel&gt;
                      &lt;ListBox x:Name="ItemsList" ItemsSource="{Binding Source={StaticResource SlideItemList}}" Margin="0,250,0,0" VerticalAlignment="Top" SelectionChanged="ItemsList_SelectionChanged" Height="430"&gt;
                          &lt;ListBox.ItemTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;StackPanel x:Name="ImgStack" HorizontalAlignment="Left" Height="430" VerticalAlignment="Top" Width="370" Margin="50,0,0,0"&gt;
                                      &lt;Image Height="350" Width="360" Source="{Binding Image}"/&gt;
                                      &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/ListBox.ItemTemplate&gt;
                      &lt;/ListBox&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/controls:Panorama.ItemTemplate&gt;
      &lt;/controls:Panorama&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Xaml.cs</p>
  
  <pre><code>  private void keyItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          var listbox = (ListBox)sender;
          var conGen = listbox.ItemContainerGenerator;
          var item = (UIElement)conGen.ContainerFromIndex(listbox.SelectedIndex);
  
          if (item != null)
          {
              int selectedItemList = listbox.SelectedIndex;
              if (sLasListItem != selectedItemList)
              {
                   // navigate to another page
                   sLasListItem = selectedItemList;
              }
          }
      }
  </code></pre>
  
  <p>Binding UI elements works perfectly.</p>
  
  <p>Problem:
  1. When i select new item from the list in one panorama item page, it will fire, the same selection changed event for all panorama items.</p>
  
  <p>Ex:
  Let's consider, i have 4 panorama items. I selected 2nd item from the 1st panorama item  list box. this selection changed event executed 4 times. </p>
  
  <p>My expectation was, when i select new item from the list, this event should fire only one time for the corresponding panorama item. </p>
  
  <p>Pls suggest me, how to do it...</p>