Utopia-Canteen-System/Views/AdminLoginView.xaml

126 lines
5.7 KiB
XML

<UserControl x:Class="UtopiaCanteenSystem.Views.AdminLoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UserControl.Resources>
<SolidColorBrush x:Key="AccentBrush" Color="#5BA3A0"/>
<SolidColorBrush x:Key="MutedTextBrush" Color="#718096"/>
<SolidColorBrush x:Key="TitleTextBrush" Color="#2D3748"/>
<SolidColorBrush x:Key="ErrorTextBrush" Color="#E53E3E"/>
<Style x:Key="RoundedButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Padding" Value="24,12"/>
<Setter Property="MinHeight" Value="50"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TextInputStyle" TargetType="TextBox">
<Setter Property="FontSize" Value="18"/>
<Setter Property="MinHeight" Value="46"/>
<Setter Property="Padding" Value="14,0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="#995BA3A0"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style x:Key="PasswordInputStyle" TargetType="PasswordBox">
<Setter Property="FontSize" Value="18"/>
<Setter Property="MinHeight" Value="46"/>
<Setter Property="Padding" Value="14,0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="#995BA3A0"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
</UserControl.Resources>
<Grid Background="#F0F2F5">
<Viewbox Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MaxWidth="650"
MaxHeight="900">
<Border HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="40"
MinWidth="450"
MaxWidth="560"
Background="White"
CornerRadius="12">
<Border.Effect>
<DropShadowEffect BlurRadius="24"
ShadowDepth="0"
Opacity="0.08"
Color="#000000"/>
</Border.Effect>
<StackPanel>
<TextBlock Text="Utopia Canteen System"
FontSize="32"
FontWeight="Bold"
Foreground="{StaticResource TitleTextBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,12"/>
<TextBlock Text="Admin Login"
FontSize="16"
Foreground="{StaticResource MutedTextBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,24"/>
<TextBlock Text="Username"
FontSize="14"
Foreground="{StaticResource MutedTextBrush}"
FontWeight="SemiBold"
Margin="0,0,0,6"/>
<TextBox x:Name="UsernameTextBox"
Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource TextInputStyle}"
Margin="0,0,0,16"/>
<TextBlock Text="Password"
FontSize="14"
Foreground="{StaticResource MutedTextBrush}"
FontWeight="SemiBold"
Margin="0,0,0,6"/>
<PasswordBox x:Name="PasswordBox"
Style="{StaticResource PasswordInputStyle}"
PasswordChanged="PasswordBox_OnPasswordChanged"
Margin="0,0,0,24"/>
<Button Content="LOGIN"
Command="{Binding AdminLoginCommand}"
Style="{StaticResource RoundedButtonStyle}"/>
<TextBlock Text="{Binding ErrorMessage}"
Foreground="{StaticResource ErrorTextBrush}"
FontSize="14"
FontWeight="SemiBold"
Margin="0,16,0,0"
HorizontalAlignment="Center"
TextAlignment="Center"
TextWrapping="Wrap"/>
</StackPanel>
</Border>
</Viewbox>
</Grid>
</UserControl>