Created login and error handling to get auth token. Refreshing not handled.
This commit is contained in:
@@ -9,15 +9,56 @@
|
||||
Title="{x:Static p:Resources.Title_Login}"
|
||||
Height="450"
|
||||
Width="800"
|
||||
xmlns:p="clr-namespace:BodyshopUploader.Properties">
|
||||
xmlns:p="clr-namespace:BodyshopUploader.Properties"
|
||||
xmlns:util="clr-namespace:BodyshopUploader.Utils"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
TextElement.FontWeight="Regular"
|
||||
TextElement.FontSize="13"
|
||||
TextOptions.TextFormattingMode="Ideal"
|
||||
TextOptions.TextRenderingMode="Auto"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||
Closing="Window_Closing">
|
||||
<Window.DataContext>
|
||||
<vm:LoginViewModel />
|
||||
</Window.DataContext>
|
||||
<Window.Resources>
|
||||
<util:NullVisibilityConverter x:Key="NullVisibilityConverter" />
|
||||
</Window.Resources>
|
||||
|
||||
<StackPanel>
|
||||
<Button Command="{Binding OpenMainCommand}"
|
||||
Content="{x:Static p:Resources.Login}" />
|
||||
<StackPanel Orientation="Vertical"
|
||||
HorizontalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Person"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBox materialDesign:HintAssist.Hint="{x:Static p:Resources.Username}"
|
||||
Width="300"
|
||||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
||||
Text="{Binding UserName}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Key"
|
||||
VerticalAlignment="Center" />
|
||||
<PasswordBox materialDesign:HintAssist.Hint="{x:Static p:Resources.Password}"
|
||||
KeyDown="PasswordBox_KeyDown"
|
||||
PasswordChanged="PasswordBox_PasswordChanged"
|
||||
Width="300"
|
||||
Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMsg}"
|
||||
Visibility="{Binding ErrorMsg, Converter={StaticResource NullVisibilityConverter}}" />
|
||||
|
||||
<TextBlock Text="{Binding Progress, TargetNullValue=QUE, FallbackValue=QUE2}" />
|
||||
<Button Command="{Binding LoginCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
|
||||
Content="{x:Static p:Resources.Login}"
|
||||
Style="{StaticResource MaterialDesignRaisedButton}"
|
||||
IsDefault="True"
|
||||
materialDesign:ButtonProgressAssist.Value="-1"
|
||||
materialDesign:ButtonProgressAssist.IsIndicatorVisible="True"
|
||||
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Loading}" />
|
||||
</StackPanel>
|
||||
</Window>
|
||||
|
||||
Reference in New Issue
Block a user