LoginView.Designer.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Terminal.Gui;
  2. namespace CommunityToolkitExample;
  3. internal partial class LoginView : Window
  4. {
  5. private Label titleLabel;
  6. private Label usernameLengthLabel;
  7. private TextField usernameInput;
  8. private Label passwordLengthLabel;
  9. private TextField passwordInput;
  10. private Label validationLabel;
  11. private Button loginButton;
  12. private Button clearButton;
  13. private Label loginProgressLabel;
  14. private void InitializeComponent ()
  15. {
  16. titleLabel = new Label ();
  17. titleLabel.Text = "Login Form";
  18. Add (titleLabel);
  19. usernameLengthLabel = new Label ();
  20. usernameLengthLabel.X = Pos.Left (titleLabel);
  21. usernameLengthLabel.Y = Pos.Top (titleLabel) + 1;
  22. Add (usernameLengthLabel);
  23. usernameInput = new TextField ();
  24. usernameInput.X = Pos.Right (usernameLengthLabel) + 1;
  25. usernameInput.Y = Pos.Top (usernameLengthLabel);
  26. usernameInput.Width = 40;
  27. Add (usernameInput);
  28. passwordLengthLabel = new Label ();
  29. passwordLengthLabel.X = Pos.Left (usernameLengthLabel);
  30. passwordLengthLabel.Y = Pos.Top (usernameLengthLabel) + 1;
  31. Add (passwordLengthLabel);
  32. passwordInput = new TextField ();
  33. passwordInput.X = Pos.Right (passwordLengthLabel) + 1;
  34. passwordInput.Y = Pos.Top (passwordLengthLabel);
  35. passwordInput.Width = 40;
  36. passwordInput.Secret = true;
  37. Add (passwordInput);
  38. validationLabel = new Label ();
  39. validationLabel.X = Pos.Left (passwordInput);
  40. validationLabel.Y = Pos.Top (passwordInput) + 1;
  41. Add (validationLabel);
  42. loginButton = new Button ();
  43. loginButton.X = Pos.Left (validationLabel);
  44. loginButton.Y = Pos.Top (validationLabel) + 1;
  45. loginButton.Text = "_Login";
  46. Add (loginButton);
  47. clearButton = new Button ();
  48. clearButton.X = Pos.Left (loginButton);
  49. clearButton.Y = Pos.Top (loginButton) + 1;
  50. clearButton.Text = "_Clear";
  51. Add (clearButton);
  52. loginProgressLabel = new Label ();
  53. loginProgressLabel.X = Pos.Left (clearButton);
  54. loginProgressLabel.Y = Pos.Top (clearButton) + 1;
  55. loginProgressLabel.Width = 40;
  56. loginProgressLabel.Height = 1;
  57. Add (loginProgressLabel);
  58. }
  59. }