Browse Source

Updated Run<T> Scenario

Tig 1 year ago
parent
commit
515bc3cce7
1 changed files with 16 additions and 16 deletions
  1. 16 16
      UICatalog/Scenarios/RunTExample.cs

+ 16 - 16
UICatalog/Scenarios/RunTExample.cs

@@ -25,7 +25,7 @@ public class RunTExample : Scenario
             // Create input components and labels
             var usernameLabel = new Label { Text = "Username:" };
 
-            _usernameText = new TextField
+            _usernameText = new()
             {
                 // Position text field adjacent to the label
                 X = Pos.Right (usernameLabel) + 1,
@@ -62,21 +62,21 @@ public class RunTExample : Scenario
 
             // When login button is clicked display a message popup
             btnLogin.Accept += (s, e) =>
-                                {
-                                    if (_usernameText.Text == "admin" && passwordText.Text == "password")
-                                    {
-                                        MessageBox.Query ("Login Successful", $"Username: {_usernameText.Text}", "Ok");
-                                        Application.RequestStop ();
-                                    }
-                                    else
-                                    {
-                                        MessageBox.ErrorQuery (
-                                                               "Error Logging In",
-                                                               "Incorrect username or password (hint: admin/password)",
-                                                               "Ok"
-                                                              );
-                                    }
-                                };
+                               {
+                                   if (_usernameText.Text == "admin" && passwordText.Text == "password")
+                                   {
+                                       MessageBox.Query ("Login Successful", $"Username: {_usernameText.Text}", "Ok");
+                                       Application.RequestStop ();
+                                   }
+                                   else
+                                   {
+                                       MessageBox.ErrorQuery (
+                                                              "Error Logging In",
+                                                              "Incorrect username or password (hint: admin/password)",
+                                                              "Ok"
+                                                             );
+                                   }
+                               };
 
             // Add the views to the Window
             Add (usernameLabel, _usernameText, passwordLabel, passwordText, btnLogin);