From 515bc3cce7265d0f571d5f0eb76c2a45ae633ddc Mon Sep 17 00:00:00 2001 From: Tig Date: Mon, 17 Jun 2024 07:55:26 -0700 Subject: [PATCH] Updated Run Scenario --- UICatalog/Scenarios/RunTExample.cs | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/UICatalog/Scenarios/RunTExample.cs b/UICatalog/Scenarios/RunTExample.cs index 4a3126982..ae62eece6 100644 --- a/UICatalog/Scenarios/RunTExample.cs +++ b/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);