Created
June 29, 2020 14:58
-
-
Save glennstephens/9d7805d9c410c0832bcb1462f004f081 to your computer and use it in GitHub Desktop.
Simple Example of using Comet to collect some data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainPage : View | |
{ | |
readonly State<string> Name = ""; | |
readonly State<string> Email = ""; | |
readonly State<string> MessageDetails = ""; | |
[Body] | |
View body() => new VStack(spacing: 10) | |
{ | |
new Text(() => $"Name"), | |
new TextField(Name, "Name"), | |
new Text(() => $"Email"), | |
new TextField(Email, "Email Address"), | |
new Button("Send", () => { | |
MessageDetails.Value = "Submitted"; | |
Name.Value = ""; | |
Email.Value = ""; | |
}).Background(Color.Blue).Color(Color.White), | |
new Text(() => $"{MessageDetails.Value}"), | |
}.FillHorizontal(true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment