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.

83 lines
2.0 KiB

1 year ago
  1. namespace GMCabsDriverAssistantSolution.Views;
  2. public partial class UserRegistrationVerifyOtpPage : ContentPage
  3. {
  4. public UserRegistrationVerifyOtpPage()
  5. {
  6. InitializeComponent();
  7. step1.Focus();
  8. step2.IsEnabled = false;
  9. step3.IsEnabled = false;
  10. step4.IsEnabled = false;
  11. }
  12. private void step1_TextChanged(object sender, TextChangedEventArgs e)
  13. {
  14. if (e.NewTextValue.Length == 1)
  15. {
  16. if (string.IsNullOrEmpty(step2.Text))
  17. {
  18. step2.IsEnabled = true;
  19. step2.Focus();
  20. }
  21. }
  22. }
  23. private void step2_TextChanged(object sender, TextChangedEventArgs e)
  24. {
  25. if (e.NewTextValue.Length == 1)
  26. {
  27. if (string.IsNullOrEmpty(step3.Text))
  28. {
  29. step3.Focus();
  30. step3.IsEnabled = true;
  31. }
  32. }
  33. if (e.NewTextValue.Length == 0)
  34. {
  35. step2.OnBackspace += EntryBackspaceEventHandler2;
  36. }
  37. }
  38. public void EntryBackspaceEventHandler2(object sender, EventArgs e)
  39. {
  40. step1.Focus();
  41. step1.Text = string.Empty;
  42. }
  43. public void EntryBackspaceEventHandler3(object sender, EventArgs e)
  44. {
  45. step2.Focus();
  46. step2.Text = string.Empty;
  47. }
  48. public void EntryBackspaceEventHandler4(object sender, EventArgs e)
  49. {
  50. step3.Focus();
  51. step3.Text = string.Empty;
  52. }
  53. private void step3_TextChanged(object sender, TextChangedEventArgs e)
  54. {
  55. if (e.NewTextValue.Length == 1)
  56. {
  57. step4.Focus();
  58. step4.IsEnabled = true;
  59. }
  60. if (e.NewTextValue.Length == 0)
  61. {
  62. step3.OnBackspace += EntryBackspaceEventHandler3;
  63. }
  64. }
  65. private void step4_TextChanged(object sender, TextChangedEventArgs e)
  66. {
  67. if (e.NewTextValue.Length == 0)
  68. {
  69. step4.OnBackspace += EntryBackspaceEventHandler4;
  70. }
  71. }
  72. }