wenxiangchao
4 天以前 2e889843b4c171f2d6ad8e0d53084040703d11f6
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<pu:WindowX x:Class="WPFProject.Login"
            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:WPFProject"
            xmlns:pu="https://opensource.panuon.com/wpf-ui"
            xmlns:purs="clr-namespace:Panuon.WPF.UI.Resources;assembly=Panuon.WPF.UI"
            xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
            mc:Ignorable="d"
            Title="{DynamicResource App.Login}"
            pu:WindowXCaption.Foreground="#FFF"
            Height="420"
            Width="380"
            pu:WindowXCaption.Background="Transparent"
            WindowStartupLocation="CenterScreen"
            Background="{StaticResource VerBar}"
            Closed="window_Closed"
            ContentRendered="WindowX_ContentRendered"
            pu:WindowXCaption.Buttons="Close">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <pu:StyleDictionary Includes="PasswordBox"/>
                <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
                <ResourceDictionary Source="/HMI.UI;component/Style/Colors.xaml"/>
            </ResourceDictionary.MergedDictionaries>
 
            <Style x:Key="SignInButtonStyle" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
                <Setter Property="Background" Value="#6CBCEA"/>
                <Setter Property="pu:ButtonHelper.PendingSpinStyle">
                    <Setter.Value>
                        <Style TargetType="pu:Spin" BasedOn="{StaticResource {x:Static pu:ButtonHelper.PendingSpinStyleKey}}">
                            <Setter Property="SpinStyle" Value="Ring2" />
                        </Style>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="pu:ButtonHelper.IsPending" Value="True">
                        <Setter Property="IsEnabled" Value="False"/>
                        <Setter Property="pu:ButtonHelper.ClickEffect" Value="Shake" />
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="{DynamicResource App.PleaseWait}" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
 
            <Style x:Key="RememberMeSwitchStyle"
       TargetType="pu:Switch">
                <Setter Property="ContentPlacement"
            Value="Left" />
                <Setter Property="BoxHeight"
            Value="16" />
                <Setter Property="BoxWidth"
            Value="32" />
                <Setter Property="CheckedBackground"
            Value="#6CBCEA" />
                <Setter Property="Background"
            Value="#DEDEDE" />
                <Setter Property="BorderBrush"
            Value="#DEDEDE" />
                <Setter Property="Foreground"
            Value="DimGray" />
                <Setter Property="ToggleSize"
            Value="10" />
                <Setter Property="ToggleShadowColor"
            Value="{x:Null}" />
                <Setter Property="CheckedBorderBrush"
            Value="#6CBCEA" />
            </Style>
 
            <Style TargetType="pu:FormGroup" BasedOn="{StaticResource InputFormGroupStyle}">
                <Setter Property="Width" Value="250" />
                <Setter Property="HeaderForeground" Value="White" />
            </Style>
 
        </ResourceDictionary>
    </Window.Resources>
 
    <Grid HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Margin="0,-30,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Image Height="25"
               Stretch="Uniform"
           HorizontalAlignment="Left"
           Source="/Icon/LoginLogo.png"
               x:Name="logoImage"
           RenderOptions.BitmapScalingMode="HighQuality" />
        <StackPanel Margin="0,50,0,0" Grid.Row="1" x:Name="formPanel" dp:StackPanelHelper.ChildSpace="20" >
            <pu:FormGroup x:Name="FrmAccount"
                          dp:FormGroupHelper.IsRequired="True">
                <TextBox x:Name="TbAccount" Style="{StaticResource EditorTextBoxStyle}"
         Background="White"
         pu:TextBoxHelper.InputLimit="UpperCaseLetters,LowerCaseLetters,Digit"
         pu:TextBoxHelper.Watermark="{DynamicResource App.Username}"/>
            </pu:FormGroup>
            <pu:FormGroup x:Name="FrmPassword" HeaderPadding="0,0,0,10"
          dp:FormGroupHelper.IsRequired="True"
          MinMessageHeight="22">
                <PasswordBox x:Name="PwdPassword" VerticalContentAlignment="Center" 
                             Style="{StaticResource SignInPasswordBoxStyle}" 
                             pu:PasswordBoxHelper.Watermark="{DynamicResource App.Password}"/>
            </pu:FormGroup>
        </StackPanel>
 
        <pu:Switch Grid.Row="3"
               HorizontalAlignment="Right"
               Margin="0,25,0,0"
                   x:Name="SwRememberMe"
                   Cursor="Hand"
                  Unchecked="SwRememberMe_Unchecked"
               Foreground="{StaticResource PrimaryColorContract}"
               Style="{StaticResource RememberMeSwitchStyle}"
               Content="{DynamicResource App.RememberMe}" />
        
        <Button Grid.Row="4"
            Margin="0,20,0,0"
            Height="40"
            Content="{DynamicResource App.Login}"
            Style="{StaticResource SignInButtonStyle}" x:Name="BtnLogin" Click="Button_Click">
        </Button>
    </Grid>
</pu:WindowX>