<Page
    x:Class="PdfViewerSamples.PdfViewerDemoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:PdfViewerSamples"
    xmlns:c1="using:C1.Xaml.PdfViewer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <c1:C1PdfViewer x:Name="pdfViewer" ViewMode="Fitted"  Grid.Row="1" />
        <TextBlock x:Name="tb" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="20" Foreground="{ThemeResource ApplicationForegroundThemeBrush}" >
                <Run Text="{Binding ElementName=pdfViewer, Path=PageNumber}"/>
                <Run Text=" / "/>
                <Run Text="{Binding ElementName=pdfViewer, Path=PageCount}"/>
        </TextBlock>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <TextBlock x:Name="orientationTxt" Text="{Binding Source={StaticResource PdfViewerSamplesLocalization}, Path=Orientation_Text}" VerticalAlignment="Center" FontSize="16" Margin="5" />
            <ComboBox x:Name="cmbOrientation" Width="120" SelectionChanged="cmbOrientation_SelectionChanged" Margin="5">
                <ComboBoxItem Content="{Binding Source={StaticResource PdfViewerSamplesLocalization}, Path=ComboBoxItemHorizontal_Content}"></ComboBoxItem>
                <ComboBoxItem Content="{Binding Source={StaticResource PdfViewerSamplesLocalization}, Path=ComboBoxItemVertical_Content}"></ComboBoxItem>
            </ComboBox>
            <Button x:Name="btnLoad" Content="{Binding Source={StaticResource PdfViewerSamplesLocalization}, Path=Load_Content}" 
                    HorizontalAlignment="Right" Margin="5" Click="btnLoad_Click" />
        </StackPanel>
        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's window size -->
            <VisualStateGroup>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="tb.FontSize" Value="12" />
                        <Setter Target="orientationTxt.FontSize" Value="12" />
                        <Setter Target="cmbOrientation.FontSize" Value="12" />
                        <Setter Target="btnLoad.FontSize" Value="12" />
                        <Setter Target="cmbOrientation.Width" Value="100" />
                        <Setter Target="btnLoad.Width" Value="80" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>