207 lines
9.8 KiB
XML
207 lines
9.8 KiB
XML
<UserControl x:Class="UtopiaCanteenSystem.Views.AdminSettingsAuthView"
|
|
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"/>
|
|
<SolidColorBrush x:Key="BorderBrush" Color="#E2E8F0"/>
|
|
|
|
<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="SecondaryButtonStyle" TargetType="Button">
|
|
<Setter Property="Foreground" Value="{StaticResource TitleTextBrush}"/>
|
|
<Setter Property="Background" Value="#f4f7f7"/>
|
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Setter Property="Padding" Value="20,12"/>
|
|
<Setter Property="MinHeight" Value="50"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="8">
|
|
<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="700"
|
|
MaxHeight="900">
|
|
<Border HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Padding="40"
|
|
MinWidth="520"
|
|
MaxWidth="620"
|
|
Background="White"
|
|
CornerRadius="12">
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="24"
|
|
ShadowDepth="0"
|
|
Opacity="0.08"
|
|
Color="#000000"/>
|
|
</Border.Effect>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Grid.Row="0">
|
|
<TextBlock Text="Admin Authentication Required"
|
|
FontSize="28"
|
|
FontWeight="Bold"
|
|
Foreground="{StaticResource TitleTextBrush}"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,0,10"/>
|
|
|
|
<TextBlock Text="Enter admin credentials to open Settings."
|
|
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}"
|
|
KeyDown="Confirm_OnKeyDown"
|
|
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"
|
|
KeyDown="Confirm_OnKeyDown"
|
|
Margin="0,0,0,24"/>
|
|
|
|
<CheckBox Content="Save credentials"
|
|
IsChecked="{Binding RememberCredentials}"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
FontSize="14"
|
|
FontWeight="SemiBold"
|
|
Margin="0,0,0,16"/>
|
|
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="16"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button Grid.Column="0"
|
|
Content="Cancel"
|
|
Command="{Binding CancelCommand}"
|
|
Style="{StaticResource SecondaryButtonStyle}"/>
|
|
|
|
<Button Grid.Column="2"
|
|
Content="Confirm"
|
|
Command="{Binding ConfirmCommand}"
|
|
Style="{StaticResource RoundedButtonStyle}"/>
|
|
</Grid>
|
|
|
|
<TextBlock Text="{Binding ErrorMessage}"
|
|
Foreground="{StaticResource ErrorTextBrush}"
|
|
FontSize="14"
|
|
FontWeight="SemiBold"
|
|
Margin="0,16,0,0"
|
|
HorizontalAlignment="Center"
|
|
TextAlignment="Center"
|
|
TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
|
|
<!-- Loader overlay -->
|
|
<Grid Grid.RowSpan="2"
|
|
Background="#80FFFFFF"
|
|
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibility}}"
|
|
IsHitTestVisible="{Binding IsBusy}">
|
|
<Border Background="White"
|
|
BorderBrush="#e2e8f0"
|
|
BorderThickness="1"
|
|
CornerRadius="12"
|
|
Padding="18"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<StackPanel>
|
|
<TextBlock Text="Authenticating…"
|
|
FontSize="16"
|
|
FontWeight="SemiBold"
|
|
Foreground="{StaticResource TitleTextBrush}"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,0,10"/>
|
|
<ProgressBar Width="220"
|
|
Height="6"
|
|
IsIndeterminate="True"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Viewbox>
|
|
</Grid>
|
|
</UserControl>
|
|
|