ImageGear for Silverlight
Designing the XAML
Send Feedback
ImageGear for Silverlight User Guide > Getting Started > ImageGear for Silverlight TWAIN C# Tutorial > Designing the XAML

Glossary Item Box

  1. Open MainPage.xaml and add the following namespace property to the base UserControl element:
    XAML Copy Code
    xmlns:IGWC="clr-namespace:ImageGear.Windows.Controls;assembly=ImageGear20.Windows.Controls"

    This allows for the PageView Class control to be added to the document.

  2. Add the following inside the Grid element:
    XAML Copy Code
    <Grid.RowDefinitions>
        <RowDefinition Height="auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Button Grid.Row="0" Content="Scan" Width="100" Margin="8,4,8,4" HorizontalAlignment="Left" x:Name="buttonScan"/>
    <TextBox Height="25" Margin="116,4,8,4" IsReadOnly="True" VerticalAlignment="Bottom" Text="Please wait while license is retrieved..." x:Name="statusText"/>
    <IGWC:PageView Grid.Row="1" x:Name="pageView"/>

    This adds a button above the pageview control.

  3. Review the MainPage.xaml; it should look like the following:
    XAML Copy Code
    <UserControl x:Class="SilverlightTwainTutorial.MainPage"
        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:IGWC="clr-namespace:ImageGear.Windows.Controls;assembly=ImageGear20.Windows.Controls"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Button Grid.Row="0" Content="Scan" Width="100" Margin="8,4,8,4" HorizontalAlignment="Left" x:Name="buttonScan"/>
            <TextBox Height="25" Margin="116,4,8,4" IsReadOnly="True" VerticalAlignment="Bottom" Text="Please wait while license is retrieved..." x:Name="statusText"/>
            <IGWC:PageView Grid.Row="1" x:Name="pageView"/>
        </Grid>
    </UserControl>
©2012. Accusoft Corporation. All Rights Reserved.