title: bind textblock to current listbox item in pure xaml
body: <p>i have some data saved in a xml file.
  Those will be displayed in a listbox.
  Now, when i change the listbox Selectedindex, i would like to update the other information in the textblock based on the selectedindex.</p>
  
  <p>is there any way to do this in pure xaml?
  if not, how would i bind the Textblock to the selecteditem in the listbox ?</p>
  
  <p><strong>EDIT:
  How would i navigate through the Data without using the listbox? i mean using a button to move to next item and other button to move backward..!!</strong></p>
  
  <p>any help is really appreciated..</p>
  
  <pre><code>&lt;Window x:Class="WpfSingleInstance.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Window1" Height="300" Width="300"&gt;
  &lt;Grid&gt;
      &lt;StackPanel
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Background="Cornsilk"&gt;
  
          &lt;StackPanel.Resources&gt;
              &lt;XmlDataProvider x:Key="InventoryData" XPath="Inventory/Books"&gt;
                  &lt;x:XData&gt;
                      &lt;Inventory xmlns=""&gt;
                          &lt;Books&gt;
                              &lt;Book ISBN="0-7356-0562-9" Stock="in" Number="9"&gt;
                                  &lt;Title&gt;XML in Action&lt;/Title&gt;
                                  &lt;Summary&gt;XML Web Technology&lt;/Summary&gt;
                              &lt;/Book&gt;
                              &lt;Book ISBN="0-7356-1370-2" Stock="in" Number="8"&gt;
                                  &lt;Title&gt;Programming Microsoft Windows With C#&lt;/Title&gt;
                                  &lt;Summary&gt;C# Programming using the .NET Framework&lt;/Summary&gt;
                              &lt;/Book&gt;
                              &lt;Book ISBN="0-7356-1288-9" Stock="out" Number="7"&gt;
                                  &lt;Title&gt;Inside C#&lt;/Title&gt;
                                  &lt;Summary&gt;C# Language Programming&lt;/Summary&gt;
                              &lt;/Book&gt;
                          &lt;/Books&gt;
                      &lt;/Inventory&gt;
                  &lt;/x:XData&gt;
              &lt;/XmlDataProvider&gt;
          &lt;/StackPanel.Resources&gt;
  
          &lt;TextBlock FontSize="18" FontWeight="Bold" Margin="10"
  HorizontalAlignment="Center"&gt;XML Data Source Sample&lt;/TextBlock&gt;
          &lt;ListBox
  Width="265" Height="98" x:Name="lbox" Background="Honeydew" IsSynchronizedWithCurrentItem="True"&gt;
              &lt;ListBox.ItemsSource&gt;
                  &lt;Binding Source="{StaticResource InventoryData}"
             XPath="*[@Stock='out'] | *[@Number&gt;=8 or @Number=3]"/&gt;
              &lt;/ListBox.ItemsSource&gt;
  
              &lt;ListBox.ItemTemplate&gt;
  
                  &lt;DataTemplate&gt;
                      &lt;TextBlock FontSize="12" Foreground="Red"&gt;
        &lt;TextBlock.Text&gt;
          &lt;Binding XPath="Title"/&gt;
        &lt;/TextBlock.Text&gt;
                      &lt;/TextBlock&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
          &lt;/ListBox&gt;
  
          &lt;StackPanel DataContext="{StaticResource InventoryData}"&gt;
              &lt;TextBlock Text="{Binding  XPath=Book/Title}"/&gt;
              &lt;TextBox Margin="5,31,98,10" x:Name="textBoxMainDetail" Text="{Binding XPath=Book/Summary}" /&gt;
          &lt;/StackPanel&gt;
      &lt;/StackPanel&gt;
  
  
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>