LoginView.xaml 6.3 KB

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