<Window x:Class="ShaferExample.AppWindow"
        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:local="clr-namespace:ShaferExample"
        mc:Ignorable="d"
        WindowStyle="None"
        MouseDown="Window_MouseDown"
        Loaded="WindowLoaded"
        Title="Sample App" Height="433" Width="786" ResizeMode="NoResize">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <Style x:Key="visibleStyle" TargetType="{x:Type ListViewItem}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Valid}" Value="True">
                    <Setter Property="Background" Value="White" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Valid}" Value="False">
                    <Setter Property="Background" Value="WhiteSmoke" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Border BorderBrush="#FFA0A0A0" BorderThickness="1">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel x:Name="Loader" Visibility="Collapsed" Background="Black" Height="452" Margin="0,0,0,0" Width="800" Opacity="0.7" Panel.ZIndex="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Height="453">
                    <Canvas Width="32" Height="32" Margin="0,60,0,0">
                        <Canvas.Triggers>
                            <EventTrigger RoutedEvent="Canvas.Loaded">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation 
                                            From="0" To="360" 
                                            RepeatBehavior="Forever" 
                                            Storyboard.TargetName="spin" 
                                            Storyboard.TargetProperty="(RotateTransform.Angle)" 
                                            />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Canvas.Triggers>
                        <Canvas.RenderTransform>
                            <RotateTransform x:Name="spin" Angle="0" CenterX="16" CenterY="16" />
                        </Canvas.RenderTransform>
                        <Image Source="Images\loader.png" Width="32" Height="32" />
                    </Canvas>
                    <TextBlock Text="Refreshing..." FontSize="18" Foreground="White" Margin="351,216,345,213" VerticalAlignment="Center" HorizontalAlignment="Center" Width="104"/>
                </Grid>
            </StackPanel>
            <Rectangle Fill="Black" Opacity="0.7" Visibility="{Binding IsOpen, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=popRegistrationData}" Height="430" Panel.ZIndex="1"/>
            <Rectangle x:Name="versionOpacity" Fill="Black" Opacity="0.7" Visibility="Hidden" Height="430" Panel.ZIndex="1"/>
            <Popup Name="popRegistrationData" Placement="Center" PopupAnimation="Fade" AllowsTransparency="True" IsOpen="False" Panel.ZIndex="1">
                <Border BorderBrush="#FFA0A0A0" BorderThickness="2">
                    <Grid Background="#FFE5E5E5" Height="264" Width="635">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Label Content="Please fill in Your registration data" HorizontalAlignment="Left" FontWeight="Bold" Margin="10,0,0,0"/>
                        <TextBox x:Name="tbFirstnamePopup" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,29,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="First Name" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbLastNamePopup" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,65,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Last Name" HorizontalAlignment="Left" Margin="10,66,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbCompanyNamePopup" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,101,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Company" HorizontalAlignment="Left" Margin="10,102,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbEmailPopup" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,137,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Email" HorizontalAlignment="Left" Margin="10,138,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbTelephonePopup" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,173,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Telephone" HorizontalAlignment="Left" Margin="10,174,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <Button Content="Update" HorizontalAlignment="Left" Margin="326,210,0,0" VerticalAlignment="Top" Width="104" Height="39" Click="SaveRegistrationData"/>
                        <Button Content="Cancel" HorizontalAlignment="Left" Margin="217,210,0,0" VerticalAlignment="Top" Width="104" Height="39" Click="CloseRegistrationDataPopup"/>
                    </Grid>
                </Border>
            </Popup>
            <Rectangle Fill="Black" Opacity="0.7" Visibility="{Binding IsOpen, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=popLtcoCheckout}" Height="430" Panel.ZIndex="1"/>
            <Popup Name="popLtcoCheckout" Placement="Center" PopupAnimation="Fade" AllowsTransparency="True" IsOpen="False" Panel.ZIndex="1">
                <Border BorderBrush="#FFA0A0A0" BorderThickness="2">
                    <Grid Background="#FFE5E5E5" Height="126" Width="232">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Label Content="LTCO days requested" HorizontalAlignment="Left" FontWeight="Bold" Margin="10,0,0,0"/>
                        <StackPanel Orientation="Horizontal" Margin="10,28,82,55">
                            <TextBox x:Name="tbLtcoDays" x:FieldModifier="private" Margin="5,5,0,5" Width="50" Height="30" Padding="5" Text="0" TextChanged="LtcoDays_TextChanged" />
                            <Button x:Name="btLtcoDaysUp" x:FieldModifier="private" Margin="5,5,5,5" Content="˄" Height="30" Width="20" Click="LtcoDaysUp_Click" />
                            <Button x:Name="btLtcoDaysDown" x:FieldModifier="private" Margin="0,5,0,5"  Content="˅" Width="20" Height="30" Click="LtcoDaysDown_Click" />
                        </StackPanel>
                        <Button Content="Checkout" HorizontalAlignment="Left" Margin="119,78,0,0" VerticalAlignment="Top" Width="104" Height="39" Click="LtcoCheckout"/>
                        <Button Content="Cancel" HorizontalAlignment="Left" Margin="10,78,0,0" VerticalAlignment="Top" Width="104" Height="39" Click="CloseLtcoCheckoutPopup"/>
                    </Grid>
                </Border>
            </Popup>

            <Separator Margin="0,38,0,388"></Separator>
            <Image Source="assets/logo.png" HorizontalAlignment="Left" Height="25" Margin="10,10,0,0" VerticalAlignment="Top" Width="198"/>
            <Image Source="assets/close.png" HorizontalAlignment="Left" Height="27" Margin="746,7,0,0" VerticalAlignment="Top" Width="27" MouseLeftButtonDown="Window_Close"/>
            <TabControl HorizontalAlignment="Left" Height="323" Margin="10,56,0,0" VerticalAlignment="Top" Width="763">
                <TabItem Header="License Info">
                    <Grid Background="#FFE5E5E5">
                        <Label Content="Lease expires:" HorizontalAlignment="Left" Margin="26,115,0,0" VerticalAlignment="Top" Height="30" RenderTransformOrigin="0.918,0.533"/>
                        <Label Content="License status:" HorizontalAlignment="Left" Margin="25,80,0,0" VerticalAlignment="Top" Height="30"/>
                        <Label Content="ComputerId:" HorizontalAlignment="Left" Margin="35,10,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbComputerId" HorizontalAlignment="Left" Height="30" Margin="144,10,0,0" VerticalAlignment="Top" Width="241"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbLicenseStatus" HorizontalAlignment="Left" Height="30" Margin="144,80,0,0" VerticalAlignment="Top" Width="241"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbLease" HorizontalAlignment="Left" Height="30" Margin="144,115,0,0" VerticalAlignment="Top" Width="241"/>
                        <Label Content="License expires:" HorizontalAlignment="Left" Margin="417,80,0,0" VerticalAlignment="Top" Height="30"/>
                        <Label Content="Activation type:" HorizontalAlignment="Left" Margin="417,45,0,0" VerticalAlignment="Top" Height="30"/>
                        <Label Content="License type:" HorizontalAlignment="Left" Margin="417,10,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbLicenseType" HorizontalAlignment="Left" Height="30" Margin="517,10,0,0" VerticalAlignment="Top" Width="230"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbActivationType" HorizontalAlignment="Left" Height="30" Margin="517,45,0,0" VerticalAlignment="Top" Width="230"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbExpires" HorizontalAlignment="Left" Height="30" Margin="517,80,0,0" VerticalAlignment="Top" Width="230"/>
                        <Label Content="in:" HorizontalAlignment="Left" Margin="487,115,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbExpiresIn" HorizontalAlignment="Left" Height="30" Margin="517,115,0,0" VerticalAlignment="Top" Width="230"/>
                        <Label Content="Available Processes:" HorizontalAlignment="Left" Margin="417,185,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbAvActivations" HorizontalAlignment="Left" Height="30" Margin="601,185,0,0" VerticalAlignment="Top" Width="146"/>
                        <Label Content="Maximum Processes:" HorizontalAlignment="Left" Margin="417,150,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbMaxActivations" HorizontalAlignment="Left" Height="30" Margin="601,150,0,0" VerticalAlignment="Top" Width="146"/>
                        <Label Content="Maintenance expiry date:" HorizontalAlignment="Left" Margin="417,220,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbMaintenenceExpiryDate" HorizontalAlignment="Left" Height="30" Margin="564,220,0,0" VerticalAlignment="Top" Width="183"/>
                        <Label Content="in:" HorizontalAlignment="Left" Margin="89,150,0,0" VerticalAlignment="Top" Height="30" RenderTransformOrigin="1.227,0.467"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbLeaseExpiredIn" HorizontalAlignment="Left" Height="30" Margin="144,150,0,0" VerticalAlignment="Top" Width="241"/>
                        <Label Content="License code:" HorizontalAlignment="Left" Margin="31,45,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbLicenseCode" HorizontalAlignment="Left" Height="30" Margin="144,45,0,0" VerticalAlignment="Top" Width="241"/>
                        <Label Content="Computer Name:" HorizontalAlignment="Left" Margin="10,185,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbHostName" HorizontalAlignment="Left" Height="30" Margin="144,185,0,0" VerticalAlignment="Top" Width="241"/>
                        <Label Content="in:" HorizontalAlignment="Left" Margin="487,255,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbMaintenenceExpiryDateIn" HorizontalAlignment="Left" Height="30" Margin="517,255,0,0" VerticalAlignment="Top" Width="230"/>
                        <Label Content="Current activations:" HorizontalAlignment="Left" Margin="10,220,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbCurrentActivations" HorizontalAlignment="Left" Height="30" Margin="144,220,0,0" VerticalAlignment="Top" Width="241"/>
                        <Label Content="Activations allowed:" HorizontalAlignment="Left" Margin="10,255,0,0" VerticalAlignment="Top" Height="30"/>
                        <TextBox Padding="5" IsReadOnly="True" x:Name="tbActivationsAllowed" HorizontalAlignment="Left" Height="30" Margin="144,255,0,0" VerticalAlignment="Top" Width="241"/>
                    </Grid>
                </TabItem>
                <TabItem Name="tabRD" Header="Registration Data">
                    <Grid Background="#FFE5E5E5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="530*"/>
                            <ColumnDefinition Width="227*"/>
                        </Grid.ColumnDefinitions>
                        <TextBox x:Name="tbFirstname" IsEnabled="false" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,29,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="First Name" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbLastName" IsEnabled="false" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,65,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Last Name" HorizontalAlignment="Left" Margin="10,66,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbCompanyName" IsEnabled="false" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,101,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Company" HorizontalAlignment="Left" Margin="10,102,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbEmail" IsEnabled="false" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,137,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Email" HorizontalAlignment="Left" Margin="10,138,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <TextBox x:Name="tbTelephone" IsEnabled="false" HorizontalAlignment="Left" Padding="5" Height="32" Margin="134,173,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296"/>
                        <Label Content="Telephone" HorizontalAlignment="Left" Margin="10,174,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <Button Content="Edit" HorizontalAlignment="Left" Margin="326,210,0,0" VerticalAlignment="Top" Width="104" Height="39" Click="EditRegistrationData"/>
                    </Grid>
                </TabItem>
                <TabItem Header="Features">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemsSource="{Binding Features}" x:Name="lvFeatures" HorizontalAlignment="Left" Height="275" Margin="10,10,0,0" VerticalAlignment="Top" Width="737" SelectionChanged="FeatureSelected">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Width="30">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsEnabled="False" IsChecked="{Binding CalculatedValue}"/>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Width="120" DisplayMemberBinding="{Binding Name}" Header="Name"/>
                                    <GridViewColumn Width="240" DisplayMemberBinding="{Binding FormatedExpirationDate}" Header="Expiration"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </TabItem>
                <TabItem Header="Agility Fields">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemsSource="{Binding Agilities}" x:Name="lvAgilities" HorizontalAlignment="Left" Height="275" Margin="10,10,0,0" VerticalAlignment="Top" Width="737">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="120" Header="Name"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding Value}" Width="607" Header="Value"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </TabItem>
                <TabItem Name="tabFF" Header="Floating Features">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemsSource="{Binding FloatingFeatures}" x:Name="lvFloatingFeatures" HorizontalAlignment="Left" Height="202" Margin="10,10,0,0" VerticalAlignment="Top" Width="737">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Width="30">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsEnabled="False" IsChecked="{Binding CalculatedValue}"/>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="120" Header="Name"/>
                                    <GridViewColumn Width="240" DisplayMemberBinding="{Binding FormatedExpirationDate}" Header="Expiration"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                        <ComboBox DisplayMemberPath="Name" x:Name="cbFloatingFeatureName" ItemsSource="{Binding FloatingFeatures}" HorizontalAlignment="Left" Padding="5" Height="32" Margin="10,253,0,0" Text="" VerticalAlignment="Top" Width="220"/>
                        <Label Content="Floating feature" HorizontalAlignment="Left" Margin="10,217,0,0" VerticalAlignment="Top" Width="119" Height="31"/>
                        <Button Content="Checkout" HorizontalAlignment="Left" Margin="340,253,0,0" VerticalAlignment="Top" Width="86" Height="31" Click="CheckoutFloatingFeature"/>
                        <Button Content="CheckIn" HorizontalAlignment="Left" Margin="431,253,0,0" VerticalAlignment="Top" Width="86" Height="31" Click="CheckInFloatingFeature"/>
                        <Label x:Name="lblFloatingFeatureValue" IsEnabled="False" HorizontalAlignment="Left" Padding="5" Height="32" Margin="235,253,0,0" VerticalAlignment="Top" Width="100"/>
                    </Grid>
                </TabItem>
                <TabItem Name="tabEP" Header="Element Pools">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemsSource="{Binding ElementsPool}" x:Name="lvElementPool" HorizontalAlignment="Left" Height="202" Margin="10,10,0,0" VerticalAlignment="Top" Width="737">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Width="30">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsEnabled="False" IsChecked="{Binding Value}"/>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="120" Header="Name"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding ValueMax}" Width="60" Header="Max"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding ValueAmt}" Width="60" Header="Amt"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                        <Label Content="Element pool" HorizontalAlignment="Left" Margin="10,217,0,0" VerticalAlignment="Top"/>
                        <Label Content="Value" HorizontalAlignment="Left" Margin="184,217,0,0" VerticalAlignment="Top"/>
                        <ComboBox DisplayMemberPath="Name" ItemsSource="{Binding ElementsPool}" x:Name="cbElementPoolName" HorizontalAlignment="Left" Padding="5" Height="32" Margin="10,248,0,0" Text="" VerticalAlignment="Top" Width="169"/>
                        <TextBox x:Name="tbElementPoolValue" HorizontalAlignment="Left" Padding="5" Height="32" Margin="184,248,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="157"/>
                        <Button Content="Checkout" HorizontalAlignment="Left" Margin="451,248,0,0" VerticalAlignment="Top" Width="75" Height="32" Click="CheckoutPoolElement"/>
                        <Button Content="CheckIn" HorizontalAlignment="Left" Margin="531,248,0,0" VerticalAlignment="Top" Width="75" Height="32" Click="CheckInPoolElement"/>
                        <Label x:Name="lblElementPoolStatus" HorizontalAlignment="Left" Margin="346,248,0,0" VerticalAlignment="Top" Height="32" Width="100"/>
                    </Grid>
                </TabItem>
                <TabItem x:Name="tabCT" Header="Consumption Tokens">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemsSource="{Binding ConsumptionTokens}" x:Name="lvConsumptionToken" HorizontalAlignment="Left" Height="202" Margin="10,10,0,0" VerticalAlignment="Top" Width="737">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Width="30">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsEnabled="False" IsChecked="{Binding Value}"/>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="120" Header="Name"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding ValueMax}" Width="60" Header="Max"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding ValueAmt}" Width="60" Header="Amt"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding Consumed}" Width="70" Header="Consumed"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                        <Label Content="Consumption Pool" HorizontalAlignment="Left" Margin="10,217,0,0" VerticalAlignment="Top"/>
                        <Label Content="Value" HorizontalAlignment="Left" Margin="184,217,0,0" VerticalAlignment="Top"/>
                        <ComboBox DisplayMemberPath="Name" ItemsSource="{Binding ConsumptionTokens}" x:Name="cbConsumptionTokenName" HorizontalAlignment="Left" Padding="5" Height="32" Margin="10,248,0,0" Text="" VerticalAlignment="Top" Width="169"/>
                        <TextBox x:Name="tbConsumptionTokenValue" HorizontalAlignment="Left" Padding="5" Height="32" Margin="184,248,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="157"/>
                        <Button Content="Checkout" HorizontalAlignment="Left" Margin="451,248,0,0" VerticalAlignment="Top" Width="75" Height="32" Click="CheckoutConsumptionToken"/>
                        <Button Content="Consume" HorizontalAlignment="Left" Margin="531,248,0,0" VerticalAlignment="Top" Width="75" Height="32" Click="ConsumeConsumptionToken"/>
                        <Label x:Name="lblConsumptionTokenStatus" HorizontalAlignment="Left" Margin="346,248,0,0" VerticalAlignment="Top" Height="32" Width="100"/>
                    </Grid>
                </TabItem>
                <TabItem x:Name="tabMessages" Header="Messages">
                    <Grid Background="#FFE5E5E5">
                        <ListView ItemContainerStyle="{DynamicResource visibleStyle}" ItemsSource="{Binding Messages}" x:Name="lvMessages" HorizontalAlignment="Left" Height="275" Margin="10,10,0,0" VerticalAlignment="Top" Width="737">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn DisplayMemberBinding="{Binding Msg}" Width="727" Header="Messages"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </TabItem>
            </TabControl>
            <WrapPanel Height="39" Margin="10,384,0,0" Width="761" HorizontalAlignment="Left" VerticalAlignment="Top" FlowDirection="RightToLeft">
                <Button x:Name="btnRefreshLicense"  Content="REFRESH LICENSE" HorizontalAlignment="Left" VerticalAlignment="Top" Width="131" Height="39" Click="RefreshLicense" RenderTransformOrigin="-0.402,-1.193" Margin="0,0,5,0"/>
                <Button x:Name="btnReturnLicense"  Content="RETURN LICENSE" HorizontalAlignment="Left" VerticalAlignment="Top" Width="123" Height="39" Click="ReturnLicense" Margin="0,0,5,0"/>
                <Button x:Name="btnReturnLicenseOffline"  Content="RETURN LICENSE OFFLINE" HorizontalAlignment="Left" VerticalAlignment="Top" Width="182" Height="39" Click="ReturnLicenseOffline" Margin="0,0,5,0"/>
                <Button x:Name="btnReturnPassiveLicense"  Content="DEACTIVATE" HorizontalAlignment="Left" VerticalAlignment="Top" Width="98" Height="39" Click="ReturnPassiveLicense" Margin="0,0,5,0"/>
                <Button Width="112" VerticalAlignment="Top" x:Name="btnRegisterNow" Height="39" HorizontalAlignment="Left" Content="REGISTER NOW" Click="RegisterNow" Margin="0,0,5,0"/>
                <Button Width="125" VerticalAlignment="Top" x:Name="btnLtco" Height="39" HorizontalAlignment="Left" Content="LTCO CHECKOUT" Click="ShowLtcoPopup" Margin="0,0,5,0"/>
            </WrapPanel>
            <Button Width="87" VerticalAlignment="Top" Height="20" HorizontalAlignment="Left" Content="Check for updates" Margin="654,10,0,0" FontSize="10" Click="CheckForUpdates"/>
            <TextBlock x:Name="AppName"  HorizontalAlignment="Left" Margin="216,5,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontWeight="Bold"/>
            <TextBlock x:Name="AppDesc" HorizontalAlignment="Left" Margin="216,21,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="11"/>
        </Grid>
    </Border>
</Window>
