How to get value datatemplate element?
<p>Here is my code</p>

<pre><code>&lt;ListBox x:Name="myList" IsSynchronizedWithCurrentItem="True" SelectionChanged="editElement"&gt;
  &lt;ListBox.ItemTemplate&gt;
    &lt;DataTemplate x:Name="ElementItemTemplate"&gt;
      &lt;StackPanel Name="stackPanelElementItem" Orientation="Horizontal"&gt;
        &lt;Label Name="SelectedItemlabel" Content="{Binding}" /&gt;
        &lt;Button Name="buttonDelElement" Click="btnDelElement"&gt;Delete&lt;/Button&gt;
      &lt;/StackPanel&gt;
    &lt;/DataTemplate&gt;
  &lt;/ListBox.ItemTemplate&gt;
&lt;/ListBox&gt;
</code></pre>

<hr>

<pre><code>private void btnDelElement(object sender, RoutedEventArgs e)
{
  ListBoxItem lbi2 = (ListBoxItem)(lstCursus.ItemContainerGenerator.ContainerFromItem(myList.Items.CurrentItem));
  String selectedItem = lbi2.Content.ToString();
  MessageBox.Show("Selected Item " + selectedItem + " .");

   private void editCursus(object sender, RoutedEventArgs e)
   {
     MessageBox.Show("Selected Item " + selectedItem + " .");
     /* some code to edit selected item using linq */
   }
</code></pre>

<p>My issue, SelectionChange doesn't work anymore and when I click on buttonDelElement, Selected Item doesn't change immediately.</p>

<p>Please, any ideas?</p>
