title: C# WP8 Get selected content from listPicker
body: <p>I can't find a way to get and show the content of the current selected item, here is the XAML:</p>
  
  <pre><code>&lt;toolkit:ListPicker Name="lp" Header="Network" SelectionChanged="selectionChanged"&gt;
              &lt;toolkit:ListPickerItem Content="aaa" /&gt;
              &lt;toolkit:ListPickerItem Content="bbb" /&gt;
  &lt;/toolkit:ListPicker&gt;
  </code></pre>
  
  <p>and the rest of the code:</p>
  
  <pre><code>private void selectionChanged(object sender, SelectionChangedEventArgs e)
      {
          try
          {
              if (e.RemovedItems != null &amp;&amp; e.RemovedItems.Count &gt; 0)
              {
                  if (this.lp.SelectedItem != null)
                  {
                      var selectedItem = (sender as ListPicker).SelectedItem;
                      int selindex = lp.SelectedIndex; //just for testing
                      MessageBox.Show(selindex.ToString()); //just for testing
                      string text = (lp.SelectedItem as ListBoxItem).Content.ToString();
                  }
              }
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
      }
  </code></pre>
  
  <p>It gives me this exception at "string text..." line:</p>
  
  <blockquote>
    <p><em>Object reference not set to an instance of an object</em></p>
  </blockquote>