From 9211ec11c112e18cd99e77f889a01110a70031ce Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 24 十一月 2025 17:47:15 +0800
Subject: [PATCH] 优化项目结构
---
WPFProject/Login.xaml | 34 ++++++++++++++--------------------
1 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/WPFProject/Login.xaml b/WPFProject/Login.xaml
index 9823fef..2b57e75 100644
--- a/WPFProject/Login.xaml
+++ b/WPFProject/Login.xaml
@@ -8,12 +8,15 @@
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="{Binding Converter={StaticResource lc},ConverterParameter='App.Login'}"
+ 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>
@@ -22,17 +25,6 @@
<ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
<ResourceDictionary Source="/HMI.UI;component/Style/Colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
-
- <Style x:Key="SignInPasswordBoxStyle" TargetType="PasswordBox" BasedOn="{StaticResource {x:Type PasswordBox}}">
- <Setter Property="pu:PasswordBoxHelper.FocusedBorderBrush" Value="#6CBCEA" />
- <Setter Property="pu:PasswordBoxHelper.FocusedShadowColor" Value="#6CBCEA" />
- <Setter Property="pu:PasswordBoxHelper.CornerRadius" Value="2" />
- <Setter Property="pu:PasswordBoxHelper.WatermarkForeground" Value="#4A4A4A" />
- <Setter Property="pu:PasswordBoxHelper.FocusedWatermarkForeground" Value="#AAAAAA" />
- <Setter Property="pu:PasswordBoxHelper.ClearButtonVisibility" Value="VisibleOnHoverAndNonnull" />
- <Setter Property="Height" Value="35" />
- <Setter Property="Padding" Value="10,0" />
- </Style>
<Style x:Key="SignInButtonStyle" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
<Setter Property="pu:ButtonHelper.PendingSpinStyle">
@@ -49,8 +41,7 @@
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource lc},
- ConverterParameter='App.PleaseWait'}" />
+ <TextBlock Text="{DynamicResource App.PleaseWait}" />
</DataTemplate>
</Setter.Value>
</Setter>
@@ -103,7 +94,7 @@
<Image Height="25"
Stretch="Uniform"
HorizontalAlignment="Left"
- Source="/Resources/JingCeLogo.png"
+ Source="/Icon/JingCeLogo.png"
RenderOptions.BitmapScalingMode="HighQuality" />
<StackPanel Margin="0,50,0,0" Grid.Row="1" x:Name="formPanel" dp:StackPanelHelper.ChildSpace="20" >
<pu:FormGroup x:Name="FrmAccount"
@@ -111,28 +102,31 @@
<TextBox x:Name="TbAccount" Style="{StaticResource EditorTextBoxStyle}"
Background="White"
pu:TextBoxHelper.InputLimit="UpperCaseLetters,LowerCaseLetters,Digit"
- pu:TextBoxHelper.Watermark="{Binding Converter={StaticResource lc},ConverterParameter='App.Username'}"/>
+ 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="{Binding Converter={StaticResource lc},ConverterParameter='App.Password'}"/>
+ 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="{Binding Converter={StaticResource lc},ConverterParameter='App.RememberMe'}" />
+ Content="{DynamicResource App.RememberMe}" />
+
<Button Grid.Row="4"
Margin="0,20,0,0"
Height="40"
- Content="{Binding Converter={StaticResource lc},ConverterParameter='App.Login'}"
+ Content="{DynamicResource App.Login}"
Style="{StaticResource SignInButtonStyle}" x:Name="BtnLogin" Click="Button_Click">
</Button>
</Grid>
--
Gitblit v1.9.1