<UserControl
    x:Class="BPASmartClient.Control.AdminstratorsView"
    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:helper="clr-namespace:BPASmartClient.Control.Helper"
    xmlns:local="clr-namespace:BPASmartClient.Control"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uc="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
    xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
    d:DesignHeight="600"
    d:DesignWidth="800"
    Loaded="UserControl_Loaded"
    mc:Ignorable="d">
    <UserControl.DataContext>
        <vm:AdminstratorsViewModel />
    </UserControl.DataContext>
    <UserControl.Resources>
        <Style x:Key="TxLogin" TargetType="TextBlock">
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Foreground" Value="#ddd" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="7*" />
            <ColumnDefinition Width="10*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="10*" />
            <RowDefinition Height="5*" />
            <RowDefinition Height="4*" />
            <RowDefinition Height="8*" />
            <RowDefinition Height="20*" />
        </Grid.RowDefinitions>
        <TextBlock Text="账号：" 
                   VerticalAlignment="Bottom" HorizontalAlignment="Right"
                   Margin="20" Foreground="#feffff"
                   Style="{StaticResource TxLogin}"
                />
        <TextBlock Text="密码：" Grid.Row="1"
                   VerticalAlignment="Top" HorizontalAlignment="Right"
                   Margin="20" Foreground="#feffff"
                   Style="{StaticResource TxLogin}"/>
        <TextBox x:Name="tbx_admin" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                 Text="{Binding Admin, Mode=TwoWay}"
                 Foreground="#F8F8FF" FontSize="20"
                 Width="180" Height="28" 
                 VerticalAlignment="Bottom" HorizontalAlignment="Center"
                 VerticalContentAlignment="Top" HorizontalContentAlignment="Center"
                 Margin="20" 
                 Background="Transparent"
                 BorderBrush="White" BorderThickness="0,0,0,1"
                 GotFocus="TextBox_GotFocus">

        </TextBox>
        <PasswordBox  x:Name="password"  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                      FontSize="20" Foreground="#F8F8FF"
                      Width="180" Margin="20" 
                      Background="Transparent"
                      VerticalAlignment="Top" HorizontalAlignment="Center"
                      VerticalContentAlignment="Top" HorizontalContentAlignment="Center"
                      BorderBrush="White" BorderThickness="0,0,0,1" CaretBrush="White"
                      helper:PasswordBoxHelper.PasswordContent="{Binding Password ,Mode=TwoWay}"
                      GotFocus="Password_GotFocus"/>
        <TextBlock Text="{Binding ErrorMessage}" 
                   Grid.Row="2" Grid.ColumnSpan="2"
                   VerticalAlignment="Top" HorizontalAlignment="Center"
                   FontFamily="楷体"
                   FontSize="16"
                   Foreground="#FFE2415C"
                   TextWrapping="Wrap" />
        <Button Grid.Row="3" Grid.ColumnSpan="2"
                FontSize="28" Foreground="#9934F7F7"
                Width="120" Height="40"           
                Background="Transparent"
                VerticalAlignment="Top"
                BorderBrush="#ff19b7ec" BorderThickness="2"
                Content="登  录"
                Command="{Binding AdminLoginCommand}" IsDefault="True"/>

        <uc:UserKeyBoard
            x:Name="myKeyboard"
            Grid.Row="4"
            Grid.ColumnSpan="2"
            Margin="100,10,100,50"
            Focusable="False" />
    </Grid>

</UserControl>
