终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
1.9 KiB

  1. using BPASmartClient.CustomResource.Pages.Model;
  2. using BPASmartClient.Helper;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. namespace BPASmartClient.CustomResource.Pages.View
  17. {
  18. /// <summary>
  19. /// SubPagLoginView.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class SubPagLoginView : Window
  22. {
  23. public SubPagLoginView()
  24. {
  25. InitializeComponent();
  26. Username.Focus();
  27. Username.SelectionStart = Username.Text.Trim().Length;
  28. ActionManage.GetInstance.Register(new Action(() =>
  29. {
  30. if (this.IsVisible)
  31. {
  32. this.DialogResult = true;
  33. this.Close();
  34. }
  35. }), "LoginOk", true);
  36. ActionManage.GetInstance.Register(new Action(() =>
  37. {
  38. if (this.IsVisible)
  39. {
  40. this.DialogResult = false;
  41. this.Close();
  42. }
  43. }), "ExitAction", true);
  44. NfcServer.GetInstance.EnableLogin = false;
  45. }
  46. private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
  47. {
  48. this.markText.Visibility = this.pb.Password.Length > 0 ? Visibility.Collapsed : Visibility.Visible;
  49. }
  50. private void TextBox_KeyDown(object sender, KeyEventArgs e)
  51. {
  52. if (e.Key == Key.Enter) pb.Focus();
  53. }
  54. private void pb_KeyDown(object sender, KeyEventArgs e)
  55. {
  56. if (e.Key == Key.Enter) ActionManage.GetInstance.Send("EnterLogin");
  57. }
  58. }
  59. }