终端一体化运控平台
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.
 
 
 

48 lines
1.5 KiB

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