<Page x:Class="OrgChartSamples.HierarchicalSample"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:c1="using:C1.Xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:orgchart="using:C1.Xaml.OrgChart"
             d:DesignHeight="300"
             d:DesignWidth="400"
             mc:Ignorable="d">

    <Page.Resources>

        <!--  template for Team objects  -->
        <DataTemplate x:Key="TeamTemplate">
            <Border Background="#90cd97" Padding="2">
                <TextBlock FontStyle="Italic"
                           FontWeight="Light"
                           Foreground="Black"
                           FontSize="10"
                           Text="{Binding Name}" />
            </Border>
        </DataTemplate>

        <!--  template for Division objects  -->
        <c1:C1HierarchicalDataTemplate x:Key="DivisionTemplate"
                                       ItemTemplate="{StaticResource TeamTemplate}"
                                       ItemsSource="{Binding Teams}">
            <DataTemplate>
                <Border Background="#fbb258">
                    <TextBlock HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="16"
                               FontWeight="Light"
                               Foreground="Black"
                               Padding="5"
                               Text="{Binding Name}" />
                </Border>
            </DataTemplate>
        </c1:C1HierarchicalDataTemplate>
        <!--  template for League objects  -->
        <c1:C1HierarchicalDataTemplate x:Key="LeagueTemplate"
                                       ItemTemplate="{StaticResource DivisionTemplate}"
                                       ItemsSource="{Binding Divisions}">
            <DataTemplate>
                <Border Background="#88bde6">
                    <TextBlock HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="18"
                               FontWeight="Light"
                               Foreground="Black"
                               Padding="12"
                               Text="{Binding Name}" />
                </Border>
            </DataTemplate>
        </c1:C1HierarchicalDataTemplate>
    </Page.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--  sample title  -->
        <StackPanel Orientation="Horizontal">
            <TextBlock VerticalAlignment="Bottom"
                       FontSize="12"
                       Text="{Binding Source={StaticResource OrgChartSamplesLocalization}, Path=HierarchicalDataTemplateOrgChartTB_Text}"
                       Visibility="Collapsed" />
            <TextBlock x:Name="_tbTotal" VerticalAlignment="Bottom" />
        </StackPanel>

        <ScrollViewer Grid.Row="1"
                      HorizontalScrollBarVisibility="Auto"
                      Padding="0"
                      VerticalScrollBarVisibility="Auto">
            <orgchart:C1OrgChart x:Name="_chart"
                                 Orientation="Horizontal"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center"
                                 ConnectorDashArray="1 2"
                                 ConnectorStroke="Gray"
                                 ItemTemplate="{StaticResource LeagueTemplate}" />
        </ScrollViewer>

    </Grid>
</Page>
