LoginView.xaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <UserControl
  2. x:Class="TeamAAS_VP.Views.User.LoginView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:prism="http://prismlibrary.com/"
  9. lex:LocalizeDictionary.DesignCulture="zh-CN"
  10. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  11. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. FontFamily="{DynamicResource DefaultFont}">
  14. <b:Interaction.Triggers>
  15. <b:EventTrigger EventName="Loaded">
  16. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  17. </b:EventTrigger>
  18. </b:Interaction.Triggers>
  19. <Viewbox Stretch="Uniform">
  20. <Grid>
  21. <materialDesign:Card
  22. Width="400"
  23. Margin="0,50,0,50"
  24. UniformCornerRadius="50">
  25. <materialDesign:Card.Resources>
  26. <!--<Style TargetType="TextBlock">
  27. <Setter Property="Foreground"
  28. Value="White" />
  29. </Style>-->
  30. </materialDesign:Card.Resources>
  31. <Grid Margin="50">
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="20*" />
  34. <RowDefinition Height="20*" />
  35. <RowDefinition Height="20*" />
  36. <RowDefinition Height="20*" />
  37. <RowDefinition Height="20*" />
  38. </Grid.RowDefinitions>
  39. <TextBlock Text="{lex:Loc 登录}"
  40. FontSize="32"
  41. HorizontalAlignment="Center" />
  42. <materialDesign:PackIcon Grid.Row="1"
  43. Kind="User"
  44. VerticalAlignment="Center" />
  45. <ComboBox Grid.Row="1"
  46. Height="50"
  47. Margin="20"
  48. materialDesign:HintAssist.Hint="{lex:Loc 用户}"
  49. HorizontalContentAlignment="Left"
  50. Style="{StaticResource MaterialDesignFloatingHintComboBox}"
  51. ItemsSource="{Binding UserNameList,Mode=TwoWay}"
  52. SelectedItem="{Binding SelectedUserName}">
  53. </ComboBox>
  54. <materialDesign:PackIcon Grid.Row="2"
  55. Kind="Password"
  56. VerticalAlignment="Center"/>
  57. <PasswordBox x:Name="PwdBox"
  58. Grid.Row="2"
  59. Height="50"
  60. Margin="20,0,20,0"
  61. KeyUp="PwdBox_KeyUp"
  62. GotFocus="PwdBox_GotFocus"
  63. HorizontalContentAlignment="Left"
  64. Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"
  65. materialDesign:HintAssist.HelperText="{lex:Loc 请输入用户登录密码}"
  66. materialDesign:HintAssist.Hint="{lex:Loc 密码}"
  67. materialDesign:TextFieldAssist.HasClearButton="True"
  68. materialDesign:PasswordBoxAssist.Password="{Binding Path=UserPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True}"/>
  69. <TextBlock x:Name="CapsLockText"
  70. Grid.Row="2"
  71. Margin="25,52,0,0"
  72. HorizontalAlignment="Left"
  73. VerticalAlignment="Top"
  74. FontSize="12"
  75. Foreground="OrangeRed"
  76. Text="⚠ 大写锁定已开启"
  77. Visibility="Collapsed"/>
  78. <Grid Grid.Row="3"
  79. Height="40"
  80. Margin="20,5,20,0">
  81. <!--<CheckBox Content="{lex:Loc 记住用户}"
  82. Foreground="Black"
  83. Style="{StaticResource MaterialDesignCheckBox}"
  84. HorizontalAlignment="Left"
  85. VerticalAlignment="Center"
  86. IsChecked="{Binding IsRemember}"/>
  87. <Button Content="{lex:Loc 注册}"
  88. HorizontalAlignment="Right"
  89. Background="Transparent"
  90. BorderBrush="Transparent"
  91. Foreground="Black"
  92. Command="{Binding SignUpCommand}"/>-->
  93. </Grid>
  94. <Button
  95. Grid.Row="4"
  96. Margin="20,10"
  97. VerticalAlignment="Top"
  98. materialDesign:ButtonAssist.CornerRadius="10"
  99. Command="{Binding LoginCommand}">
  100. <StackPanel Orientation="Horizontal">
  101. <materialDesign:PackIcon Kind="Login" />
  102. <TextBlock Margin="20,0,0,0" Text="{lex:Loc 登录}" />
  103. </StackPanel>
  104. </Button>
  105. <Button
  106. Grid.Row="4"
  107. Width="50"
  108. Height="50"
  109. Margin="0,55,0,0"
  110. Padding="0"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center"
  113. materialDesign:ButtonAssist.CornerRadius="5"
  114. Command="{Binding CardLoginCommand}"
  115. IsEnabled="{Binding IsLogining, Converter={StaticResource InvertBooleanConverter}}"
  116. ToolTip="刷卡登录"
  117. Visibility="{Binding CardBtnVisibility}">
  118. <Button.Content>
  119. <materialDesign:PackIcon Kind="CreditCardScanOutline" />
  120. </Button.Content>
  121. </Button>
  122. </Grid>
  123. </materialDesign:Card>
  124. </Grid>
  125. </Viewbox>
  126. </UserControl>