title: Access list box selected item from the user control windows phone 7
body: <p>I need to access list box selected item from the user control. How can I manage that?
  For example If I have ListBox <code>x:Name="NewPicturesListBox"</code> in MainPage.xaml</p>
  
  <pre><code>!--Panorama item New one--&gt;
              &lt;controls:PanoramaItem Header="New one"  Name="Pan1" &gt;
                  &lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt;
                      &lt;ListBox Margin="0,0,-12,0" x:Name="NewPicturesListBox"
  </code></pre>
  
  <p>And I need to access them from DetailControl.xaml.cs
  The code below can give me the result within the MainPage.xaml, what about other pages, if any possibility exist? </p>
  
  <pre><code>                if (NewPicturesListBox.ItemContainerGenerator != null)
                  {
                      var contextMenuListItem = (ListBoxItem)(NewPicturesListBox.ItemContainerGenerator.ContainerFromItem(((MenuItem)sender).DataContext));
                      if (contextMenuListItem != null)
                      {
                          var selectedPicture = (contextMenuListItem).Content as Picture;
  </code></pre>