LoginPage.xaml
1.8 KB
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
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:conv="clr-namespace:IndustrialControl.Converters"
x:Class="IndustrialControl.Pages.LoginPage"
Title="登录">
<ContentPage.Resources>
<ResourceDictionary>
<conv:BoolNegationConverter x:Key="NotBool" />
<conv:EyeGlyphConverter x:Key="EyeGlyphConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<Grid Padding="24" RowDefinitions="Auto,*">
<VerticalStackLayout Spacing="12">
<Label Text="联创数智管家" FontAttributes="Bold" FontSize="28"/>
<Entry Placeholder="请输入用户名" Text="{Binding UserName}"/>
<!-- 密码输入 + 眼睛图标 -->
<Grid ColumnDefinitions="*,Auto">
<Entry
Grid.Column="0"
Placeholder="请输入登录密码"
Text="{Binding Password}"
IsPassword="{Binding ShowPassword, Converter={StaticResource NotBool}}" />
<ImageButton Grid.Column="1"
VerticalOptions="Center"
BackgroundColor="Transparent"
Command="{Binding TogglePasswordCommand}">
<ImageButton.Source>
<FontImageSource Glyph="{Binding ShowPassword, Converter={StaticResource EyeGlyphConverter}}"
FontFamily="MaterialIcons" Color="Gray" Size="20"/>
</ImageButton.Source>
</ImageButton>
</Grid>
<Button Text="登录" Command="{Binding LoginCommand}"/>
</VerticalStackLayout>
</Grid>
</ContentPage>