<UserControl x:Class="BarCodesSample.NewBarcode"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:BarCodesSample"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <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.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>        
        
        <StackPanel Orientation="Vertical" Margin="10">
            <TextBlock Text="Select Barcode Type:" Margin="5" VerticalAlignment="Center"  />
            <c1:C1ComboBox x:Name="BarcodeType" IsEditable="False" SelectedItemChanged="BarcodeType_SelectedItemChanged" Width="200"  Margin="10" />
            <TextBlock Text="Data:" Margin="5" VerticalAlignment="Center" />
            <TextBox x:Name="BarcodeText" Text="9790123456785" MinHeight="50" Margin="10" Width="200"
                     VerticalAlignment="Center" AcceptsReturn="True" TextWrapping="Wrap" />
            <Button x:Name="Generate" Content="Regenerate barcode image" Margin="10" Padding="4" Click="Generate_Click"   />
        </StackPanel>
        <c1:C1BarCode x:Name="barCode" Grid.Column="1" Margin="50" CaptionPosition="Below" ContextMenu="{StaticResource saveMenu}" VerticalAlignment="Top" HorizontalAlignment="Left" />
    </Grid>
</UserControl>
