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

    <Grid >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <local:EncodingFormat x:Name="category" Grid.RowSpan="3"/>
        <local:Editor x:Name="editor" CurrentCategory="{Binding CurrentCategory, ElementName=category}"  Grid.Column="1" Grid.RowSpan="3"/>
        <Grid Grid.Column="2" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="240" />
            </Grid.RowDefinitions>
            <Button Width="140" Height="40" Content="Generate" Click="GenerateBarCode"  Grid.Row="0" Margin="4"></Button>
            <TextBlock Text="BarCode Image:" TextWrapping="WrapWholeWords" FontSize="20" Margin="4,10" Grid.Row="1"/>
            <ScrollViewer Grid.Row="2" Background="White" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
                <Grid>
                    <c1:C1BarCode x:Name="barCode" Margin="18" CaptionPosition="Below"
                                  CodeType="{Binding CurrentCodeType, ElementName=category}" >
                        <c1:C1BarCode.QRCodeOptions>
                            <BarCode:QRCodeOptions ErrorLevel="High"></BarCode:QRCodeOptions>
                        </c1:C1BarCode.QRCodeOptions>
                    </c1:C1BarCode>
                    <Image x:Name="logo" 
                           Width="50" 
                           Height="50" 
                           Source="../Resources/c1logo.png" 
                           Visibility="{Binding Path=ShowStatus, ElementName=category}">
                    </Image>
                </Grid>
            </ScrollViewer>
        </Grid>
    </Grid>
</Page>
