Repository navigation
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
74 lines (68 loc) · 4.3 KB
/
Copy pathMainWindow.xaml
File metadata and controls
74 lines (68 loc) · 4.3 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
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
<Window x:Class="CookMaster.MainWindow"
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:CookMaster"
xmlns:behaviors="clr-namespace:CookMaster.Behaviors"
mc:Ignorable="d"
Title="CookMaster" Height="510" Width="500"
WindowStartupLocation="CenterScreen"
Style="{StaticResource {x:Type Window}}">
<Grid>
<StackPanel Width="auto" Height="auto" VerticalAlignment="Center" HorizontalAlignment="Center">
<!-- Header -->
<Image Source="{StaticResource SteamingPotImage}"
Width="80" Height="80" Stretch="Uniform"
Margin="0,0,0,0" HorizontalAlignment="Center"/>
<TextBlock Text="CookMaster" FontSize="42" FontWeight="Bold"
HorizontalAlignment="Center" Margin="0,0,0,30"/>
<!-- Username Input Box -->
<TextBlock Text="Username:" Margin="3" FontSize="14" FontWeight="DemiBold"/>
<TextBox Text="{Binding Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Margin="3, 0, 3, 3" Padding="3"
Style="{StaticResource RoundedTextBoxStyle}"
behaviors:FocusBehavior.IsFocused="{Binding FocusUsername, Mode=TwoWay}"
behaviors:EnterKeyBehavior.EnterKeyCommand="{Binding PerformTrySignInCommand}" />
<!-- Password Input Box -->
<TextBlock Text="Password:" Margin="3" FontSize="14" FontWeight="DemiBold"/>
<PasswordBox Margin="3, 0, 3, 3" Padding="3"
Style="{StaticResource RoundedPasswordBoxStyle}"
behaviors:PasswordBoxAssistant.BindPassword="True"
behaviors:PasswordBoxAssistant.BoundPassword="{Binding Password, Mode=TwoWay}"
behaviors:EnterKeyBehavior.EnterKeyCommand="{Binding PerformTrySignInCommand}" />
<!-- Forgot Password Link -->
<TextBlock FontSize="12" HorizontalAlignment="Center" TextAlignment="Center" Margin="3">
<Hyperlink Command="{Binding PerformOpenForgotPasswordWindowCommand}">Forgot password?</Hyperlink>
</TextBlock>
<!-- Two-Factor Authentication Input Box & Button -->
<StackPanel Margin="3 12 0 0">
<TextBlock Text="2FA Code:" FontWeight="DemiBold"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Text="{Binding TwoFactorCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Margin="0, 0, 3, 0" Padding="3"
Style="{StaticResource RoundedTextBoxStyle}"
behaviors:FocusBehavior.IsFocused="{Binding FocusTwoFactorCode, Mode=TwoWay}"
behaviors:EnterKeyBehavior.EnterKeyCommand="{Binding PerformTrySignInCommand}" />
<Button Content="Send Code" Command="{Binding PerformSendTwoFactorCodeCommand}"
Width="80" Height="30" Margin="6,0,0,0" Grid.Column="1"
ToolTip="Send 2FA Code"
Style="{StaticResource ButtonLightGrayStyle}"/>
</Grid>
</StackPanel>
<!-- Sign In and Register Buttons -->
<StackPanel Orientation="Horizontal" Margin="0 21 0 0" HorizontalAlignment="Center">
<Button Content="Sign In" Command="{Binding PerformTrySignInCommand}"
Width="100" Height="30" Margin="6"
Style="{StaticResource ButtonLightGrayStyle}"/>
<Button Content="Register" Command="{Binding PerformOpenRegisterWindowCommand}"
Width="100" Height="30" Margin="6"
Style="{StaticResource ButtonBlueStyle}"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>