<UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:BarCodesSample"
        xmlns:BarCode="clr-namespace:C1.BarCode;assembly=C1.WPF.BarCode.4"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="BarCodesSample.DemoPage"
        >
    <Grid Margin="10">
        <Grid.Resources>
            <ContextMenu x:Key="saveMenu">
                <MenuItem Header="Export to Image" Click="MenuItem_Click">
                    <MenuItem.Icon>
                        <Image Source="Resources/save.png"/>
                    </MenuItem.Icon>
                </MenuItem>
            </ContextMenu>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <local:EncodingFormat x:Name="category"/>
        <local:Editor x:Name="editor" CurrentCategory="{Binding CurrentCategory, ElementName=category}" Grid.Column="1"/>
        <Grid Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="BarCode Image:" HorizontalAlignment="Center" FontSize="20" Margin="4,10"/>
            <ScrollViewer Grid.Row="1" HorizontalAlignment="Center" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <Grid>
                    <c1:C1BarCode x:Name="barCode" Margin="18" CaptionPosition="Below" 
						HorizontalAlignment="Center"
						CodeType="{Binding CurrentCodeType, ElementName=category}"
						Text="{Binding DataContext.EncodingText, ElementName=editor}"
                        ContextMenu="{StaticResource saveMenu}">
                        <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" 
						HorizontalAlignment="Center"
						VerticalAlignment="Center"
						Visibility="{Binding ShowStatus, ElementName=category}"/>
                </Grid>
            </ScrollViewer>

        </Grid>
    </Grid>
</UserControl>
