<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Wiązanie danych XML">
  <Window.Resources>
    <HierarchicalDataTemplate DataType="GameStats"
      ItemsSource="{Binding XPath=*}">
      <TextBlock FontStyle="Italic" Text="Statystyki gier"/>
    </HierarchicalDataTemplate>
    <HierarchicalDataTemplate DataType="GameStat" ItemsSource="{Binding XPath=*}">
      <TextBlock FontWeight="Bold" FontSize="20" Text="{Binding XPath=@Type}"/>
    </HierarchicalDataTemplate>
    <DataTemplate DataType="HighScore">
      <TextBlock Foreground="Blue" Text="{Binding XPath=.}"/>
    </DataTemplate>
    <XmlDataProvider x:Key="dataProvider" XPath="GameStats">
      <x:XData>
        <GameStats xmlns="">
          <!-- Jedna dana statystyczna na typ gry -->
          <GameStat Type="Beginner">
            <HighScore>1203</HighScore>
          </GameStat>
          <GameStat Type="Intermediate">
            <HighScore>1089</HighScore>
          </GameStat>
          <GameStat Type="Advanced">
            <HighScore>541</HighScore>
          </GameStat>
        </GameStats>
      </x:XData>
    </XmlDataProvider>
  </Window.Resources>
  <Grid>
    <Menu ItemsSource="{Binding Source={StaticResource dataProvider}, XPath=.}" />
  </Grid>
</Window>
