title: how to access DataCollection
body: <p>I have a Pivot view in my WP8 app, and I'm trying to access the data collection from the view's class upon <code>Click</code> event "removePin".
  The source of the data collection is another class called <code>Pins</code>.</p>
  
  <p>how can I achieve that? </p>
  
  <p>this is my snippet code for the XAML for that particular part</p>
  
  <pre><code>&lt;phone:PivotItem Header="Pins"&gt;
     &lt;!-- Content Panel --&gt;
     &lt;Grid x:Name="ContentPanel2" HorizontalAlignment="Left" Height="583" Margin="10,10,0,0" Grid.Row="1" VerticalAlignment="Top" Width="460"&gt;
        &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="400*"/&gt;
              &lt;ColumnDefinition Width="0*"/&gt;
              &lt;ColumnDefinition Width="87*"/&gt;
        &lt;/Grid.ColumnDefinitions&gt;
        &lt;ListBox x:Name="lstData2" ItemsSource="{Binding DataCollection2, Source={StaticResource PinsCollection}}" 
         Grid.ColumnSpan="3" Foreground="#FF1D53D0" Height="583" VerticalAlignment="Bottom"&gt;
            &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                 &lt;StackPanel Orientation="Horizontal" Tap="StackPanel_Tap"&gt;
                    &lt;Image Margin="8" VerticalAlignment="Top" Source="{Binding ImageUri}"
                       Width="100" Height="100" /&gt;
                    &lt;StackPanel Height="93" Width="259" &gt;
                        &lt;TextBlock Margin="8" Width="250" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="#FF1D53D0"
                         Text="{Binding Pinnedname}"  Height="33" RenderTransformOrigin="0.5,0.5" FontFamily="Segoe WP SemiLight" FontSize="24" FontWeight="Bold" /&gt;
                        &lt;TextBlock Width="155" Margin="8,0,8,8" VerticalAlignment="Top"
                         HorizontalAlignment="Left" Text="{Binding Status}" Foreground="#FF1D53D0" FontFamily="Segoe WP SemiLight" /&gt;
                   &lt;/StackPanel&gt;
                &lt;toolkit:ContextMenuService.ContextMenu&gt;
                   &lt;toolkit:ContextMenu&gt;
                      &lt;toolkit:MenuItem Header="Remove Pin" Click="RemovePin_Click" Tag="{Binding pinId}"/&gt;
                   &lt;/toolkit:ContextMenu&gt;
                &lt;/toolkit:ContextMenuService.ContextMenu&gt;
              &lt;/StackPanel&gt;
           &lt;/DataTemplate&gt;
        &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
      &lt;!-- End of Content Panel --&gt;
    &lt;/Grid&gt;
  </code></pre>
  
  <p></p>