<Page
    x:Class="C1FlexReportExplorer.CatalogView"
    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:c1="using:C1.Xaml"
    xmlns:fv="using:C1.Xaml.FlexViewer"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <fv:ViewHeader x:Name="viewHeader">
            <fv:ViewHeader.HeaderContent>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <TextBlock
                        Style="{ThemeResource PageTitleTextBlockStyle}"
                        Text="{Binding CatalogToolLabel, Source={StaticResource FlexReportExplorerLocalization}}"
                        />
                    <AppBarButton
                        Grid.Column="1"
                        Icon="Cancel"
                        ToolTipService.ToolTip="{Binding CloseButtonToolTip, Source={StaticResource FlexReportExplorerLocalization}}"
                        Tapped="Close_Tapped"/>
                </Grid>
            </fv:ViewHeader.HeaderContent>
        </fv:ViewHeader>

        <c1:C1TreeView
            x:Name="treeView"
            Grid.Row="1"
            ItemTemplateSelector="{StaticResource TemplateSelector}"
            ItemContainerStyleSelector="{StaticResource TemplateStyleSelector}"
            HorizontalAlignment="Stretch"
            ItemClick="TreeView_ItemClick"
            />

    </Grid>
</Page>
