I have a TabControl that has tabs for certain nodes of my XML. In each tab there is a ListBox with other items loaded from XML. Next part of the window is taken by stackpanel that has textboxes inside that are supposed to display currently selected item. Changing tabs works and it changes displayed item, but selecting item in listbox doesn't.
XML
<?xml version="1.0" encoding="utf-8"?><Language id="french"><Session id="1"><Word><Original>le poisson</Original><Translated>ryba</Translated></Word><Word><Original>le chien</Original><Translated>pies</Translated></Word></Session><Session id="2"><Word><Original>le garcon</Original><Translated>chlopiec</Translated></Word><Word><Original>la fille</Original><Translated>dziewczynka</Translated></Word></Session></Language>
XAML
<Window x:Class="Language_Learner.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Language_Learner" mc:Ignorable="d" Title="MainWindow" Height="350" Width="683.5"><Window.Resources><DataTemplate x:Key="wordItemTemplate"><Label Content="{Binding XPath=Original}"/></DataTemplate><DataTemplate x:Key="listBoxIT"><ListBox Visibility="Visible" SelectionMode="Single" ItemsSource="{Binding}" ItemTemplate="{StaticResource wordItemTemplate}" IsSynchronizedWithCurrentItem="True" /></DataTemplate><DataTemplate x:Key="tabIT"><Label Content="{Binding XPath=@id}"/></DataTemplate><XmlDataProvider x:Key="SessionData" x:Name="SessionData" Source="Main.xml" XPath="Language/Session"/></Window.Resources><Grid Margin="0,0,2,0" DataContext="{Binding Source={StaticResource SessionData}}"><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition Width="0*"/><ColumnDefinition Width="0*"/></Grid.ColumnDefinitions><StackPanel Margin="281,44,160,167"><StackPanel Orientation="Horizontal"><Label>Session ID:</Label><TextBox Text="{Binding XPath=@id}" Width="34" /></StackPanel><StackPanel Orientation="Horizontal"><Label Width="66">Original:</Label><TextBox Text="{Binding XPath=Word/Original}" Width="127" /></StackPanel><StackPanel Orientation="Horizontal"><Label>Translated:</Label><TextBox Text="{Binding XPath=Word/Translated}" Width="109" /></StackPanel><StackPanel><Button x:Name="btnSave" Content="Save" HorizontalAlignment="Left" VerticalAlignment="Top" Width="74" Click="btnSave_Click"/></StackPanel></StackPanel><TabControl x:Name="tabControl" HorizontalAlignment="Left" Height="272" Margin="10,10,0,0" VerticalAlignment="Top" Width="266" SelectedIndex="0" ItemsSource="{Binding}" ItemTemplate="{StaticResource tabIT}" ContentTemplate="{StaticResource listBoxIT}" IsSynchronizedWithCurrentItem="True"></TabControl></Grid></Window>