schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<Window x:Class="XHandler.MicroBioLoginWindow"
        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:XHandler"
        xmlns:ctrls="clr-namespace:XHandler.Controls"
        xmlns:str="clr-namespace:XHandler.Properties"
        mc:Ignorable="d" WindowStartupLocation = "CenterOwner"
        Title="LoginWindow" Height="450" Width="800" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
        WindowState="Maximized" Loaded="Window_Loaded">
       <Grid>
        <Border Background="White" BorderBrush="Gray" CornerRadius="20" Height="450" Width="800" ClipToBounds="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="400"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
 
                <Image Grid.Column="0" Source="/Assets/microbio_bg.png" Width="400" Height="450" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry RadiusX="20" RadiusY="20" Rect="0,0,420,450"/>
                    </Image.Clip>
                </Image>
 
                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition Height="110"></RowDefinition>
                        <RowDefinition Height="60"></RowDefinition>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition Height="50"></RowDefinition>
                        <RowDefinition Height="50"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <!--<Button Name="btnClose" Grid.Row="0" Width="40" Height=" 40" HorizontalAlignment="Right" Cursor="Hand" Click="btnClose_Click" Margin="10 0">
                        <Button.Template>
                            <ControlTemplate>
                                <Grid Background="Transparent">
                                    <Line Width="20" Height="20" X1="0" Y1="0" X2="20" Y2="20" StrokeThickness="3" Stroke="#D0D0D0" ></Line>
                                    <Line Width="20" Height="20" X1="20" Y1="0" X2="0" Y2="20" StrokeThickness="3" Stroke="#D0D0D0" ></Line>
                                </Grid>
                            </ControlTemplate>
                        </Button.Template>
                    </Button>-->
                    <Button Content="×" HorizontalAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Center" Margin="10 0" FontSize="32" Width="40" Height="40"
                            FontWeight="Bold" Foreground="Gray" Style="{DynamicResource BlueButtonStyle}" Background="Transparent" Click="btnClose_Click"/>
                    <Image Grid.Row="0" Grid.RowSpan="2" Source="Assets/microbio_login.png" Stretch="Fill" Width="120" Height="120" VerticalAlignment="Bottom"></Image>
                    <Label Grid.Row="2"  Name="lblSysName" Content="" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0" FontSize="32" FontWeight="Bold"></Label>
                    <Label Grid.Row="3" Content="{x:Static str:Resources.strWelcomLogin}" VerticalAlignment="Bottom" FontSize="16" Foreground="#909090" Margin="60,0,0,0"></Label>
                    <Grid Grid.Row="4" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="90"></ColumnDefinition>
                            <ColumnDefinition Width="230"></ColumnDefinition>
                            <ColumnDefinition Width="130"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Image Source="Assets/Login_User.png" Width="20" Height="20" HorizontalAlignment="Left" Margin="60 0 0 0"></Image>
                        <!--<TextBox x:Name="LoginUser" Grid.Column="1" Height="36" Width="200" Template="{StaticResource P}" ></TextBox>-->
                        <ctrls:PromptTextBox x:Name="LoginUser" Grid.Column="1" Height="30" Watermark="{x:Static str:Resources.strUserName}" VerticalAlignment="Center"
                                             FontSize="16" BorderThickness="0" BorderBrush="Red" VerticalContentAlignment="Center" 
                                             TextChanged="LoginUser_TextChanged"/>
                        <Label x:Name="LoginUserTips" IsTabStop="False" Grid.Column="2" Visibility="Collapsed" HorizontalAlignment="Left" Content="用户名不正确!" VerticalAlignment="Center" Foreground="Red"></Label>
                    </Grid>
                    <GridSplitter Grid.Row="4" KeyboardNavigation.IsTabStop="False" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="1" Background="#808080" Margin="60 0"></GridSplitter>
 
                    <Grid Grid.Row="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="90"></ColumnDefinition>
                            <ColumnDefinition Width="230"></ColumnDefinition>
                            <ColumnDefinition Width="130"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Image Source="Assets/Login_Password.png" Width="20" Height="20" HorizontalAlignment="Left" Margin="60 0 0 0"></Image>
                        <!--<PasswordBox x:Name="LoginPassword" Grid.Column="1"  Height="36" Width="200" Template="{StaticResource SearchPasswordBoxTemplate}"></PasswordBox>-->
                        <PasswordBox x:Name="LoginPassword" Grid.Column="1" FontSize="16" Height="30" MaxLength="30" VerticalAlignment="Center" BorderBrush="Red" BorderThickness="0" Margin="2 0 0 0"
                                     VerticalContentAlignment="Center" PasswordChanged="LoginPassword_PasswordChanged" PreviewKeyDown="LoginPassword_PreviewKeyDown">
                            <PasswordBox.Background>
                                <VisualBrush TileMode="None" Opacity="1" Stretch="None" AlignmentY="Center"  AlignmentX="Left" ViewportUnits="RelativeToBoundingBox">
                                    <VisualBrush.Visual>
                                        <TextBlock x:Name="pawdHintText" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{x:Static str:Resources.strPassword}" FontSize="16" Foreground="#909090"/>
                                    </VisualBrush.Visual>
                                </VisualBrush>
                            </PasswordBox.Background>
                        </PasswordBox>
 
                        <Label x:Name="LoginPasswordTips" Grid.Column="2" Visibility="Hidden" HorizontalAlignment="Left" Content="密码不正确!" VerticalAlignment="Center" Foreground="Red"></Label>
                    </Grid>
                    <GridSplitter Grid.Row="5" KeyboardNavigation.IsTabStop="False" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="60 0" Height="1" Background="#808080"></GridSplitter>
                   
                    <Button x:Name="btnLogin" Grid.Row="6" Content="{x:Static str:Resources.btnLogin}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="60 0" FontSize="16" Height="40"
                            Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnLogin_Click_1"/>
 
                </Grid>
            </Grid>
        </Border>
 
    </Grid>
</Window>