<Page x:Class="ShaferExample.AblActivation"
      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:local="clr-namespace:ShaferExample"
      mc:Ignorable="d"
      Title="OnlineActivation" Height="570" Width="770">

    <Grid Margin="0,0,0,10">
        <TextBlock HorizontalAlignment="Left" Margin="0,1,0,0" TextWrapping="Wrap" Text="ACCOUNT BASED LICENSING" VerticalAlignment="Top" FontFamily="Open Sans Semibold" Height="42" Width="572" FontSize="36"/>
        <TextBlock HorizontalAlignment="Left" Margin="0,48,0,0" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed convallis semper erat volutpat dapibus. Aliquam ac tristique neque. Nulla et sodales mi, a malesuada dolor. Vestibulum porta efficitur libero eget viverra. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam ac fermentum tortor." VerticalAlignment="Top" Height="89" Width="572" FontSize="14" FontFamily="Segoe UI Symbol"/>
        <TextBox Name="tbUsername" Padding="5" HorizontalAlignment="Left" Height="38" Margin="0,150,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="305" FontSize="16"/>
        <TextBlock HorizontalAlignment="Left" Margin="0,130,0,0" TextWrapping="Wrap" Text="Username" VerticalAlignment="Top" RenderTransformOrigin="-0.451,0.579" Height="19" Width="172"/>
        <PasswordBox x:Name="pbPassword" Padding="5" HorizontalAlignment="Left" Height="38" Margin="0,214,0,0" VerticalAlignment="Top" Width="305" FontSize="16"/>
        <TextBox x:Name="tbPassword" Padding="5" HorizontalAlignment="Left" Height="38" Margin="0,214,0,0" VerticalAlignment="Top" Width="305" FontSize="16" Visibility="Collapsed" />
        <TextBlock HorizontalAlignment="Left" Margin="0,193,0,0" TextWrapping="Wrap" Text="Password" VerticalAlignment="Top" RenderTransformOrigin="-0.451,0.579" Height="19" Width="172"/>
        <Image x:Name="imgEyeOff" Source="assets/eye-off.png" Cursor="Hand"  HorizontalAlignment="Left" Height="32" Margin="310,217,0,0" VerticalAlignment="Top" Width="32" MouseLeftButtonDown="EyeOffClick" RenderTransformOrigin="0.484,0.359"/>
        <Image x:Name="imgEye" Source="assets/eye.png" Cursor="Hand" HorizontalAlignment="Left" Height="32" Margin="310,217,0,0" VerticalAlignment="Top" Width="32" Visibility="Collapsed" MouseLeftButtonDown="EyeClick"/>
        <WrapPanel HorizontalAlignment="Left" Height="303" VerticalAlignment="Top" Width="760" Margin="0,257,0,0">
            <Grid Width="435" Height="40" Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=cbOffline}">
                <Button x:Name="btngenerateCert" Margin="0,0,285,0" Content="Generate" VerticalAlignment="Top" Height="39" Click="Generate"/>
            </Grid>
            <Grid Width="759" Margin="0,5,0,0" Height="131" Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=cbOffline}">
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Activation certificate" VerticalAlignment="Top" Height="19" Width="172"/>
                <TextBox x:Name="tbActivationCertificate" HorizontalAlignment="Left" Height="38" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="553" IsEnabled="False" TextChanged="ActivationCertificateTextChanged" Margin="0,19,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Type Activation Code provided by page" VerticalAlignment="Top" Height="19" Width="553" Margin="0,62,0,0"/>
                <TextBox x:Name="tbActivationCode" TextChanged="ActivationCodeTextChanged" Padding="5" HorizontalAlignment="Left" Height="38" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="553" FontSize="16" Margin="0,86,0,0"/>
                <Button x:Name="btnCopyToClipboard"  Content="Copy to clipboard" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="38" Click="CopyToClipboard" Visibility="Hidden" Margin="558,19,0,0"/>
                <Button x:Name="btnCopyFromClipboard"  Content="Paste from clipboard" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="38" Click="CopyFromClipboard" Visibility="Hidden" Margin="558,86,0,0"/>
            </Grid>
            <Grid Width="552">
                <Button Content="Cancel" VerticalAlignment="Top" Width="150" Height="39" Click="Cancel" Margin="0,0,402,0"/>
                <Button x:Name="btnActivateApp" Margin="155,0,247,0" Content="Activate" VerticalAlignment="Top" Width="150" Height="39" Click="GetLicense"/>
            </Grid>
            <Grid Height="89" Margin="0,5,0,0">
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." VerticalAlignment="Top" Height="22" Width="389" FontSize="14" FontFamily="Segoe UI Symbol"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Online activation" VerticalAlignment="Top" Height="22" Width="112" FontSize="14" FontFamily="Segoe UI Semibold" Foreground="#FF49AEF3" MouseLeftButtonDown="OnlineActivation" Margin="352,0,0,0" />
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Nulla et sodales mi, a malesuada dolor. Vestibulum porta efficitur libero eget viverra." VerticalAlignment="Top" Height="22" Width="572" FontSize="14" FontFamily="Segoe UI Symbol" Margin="0,22,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." VerticalAlignment="Top" Height="22" Width="389" FontSize="14" FontFamily="Segoe UI Symbol" Margin="0,44,0,0"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Offline activation" VerticalAlignment="Top" Height="22" Width="112" FontSize="14" FontFamily="Segoe UI Semibold" Foreground="#FF49AEF3" MouseLeftButtonDown="OfflineActivation" Margin="352,44,0,0" />
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Nulla et sodales mi, a malesuada dolor. Vestibulum porta efficitur libero eget viverra." VerticalAlignment="Top" Height="22" Width="572" FontSize="14" FontFamily="Segoe UI Symbol" Margin="0,66,0,0"/>
            </Grid>
        </WrapPanel>
        <CheckBox x:Name="cbOffline" Content="Offline activation" IsChecked="false" HorizontalAlignment="Left" Margin="177,132,0,0" VerticalAlignment="Top" Width="128" Checked="OfflineChange" Unchecked="OfflineChange"/>

    </Grid>
</Page>
