Skip to content

Instantly share code, notes, and snippets.

@glennstephens
Created June 29, 2020 14:58
Show Gist options
  • Save glennstephens/9d7805d9c410c0832bcb1462f004f081 to your computer and use it in GitHub Desktop.
Save glennstephens/9d7805d9c410c0832bcb1462f004f081 to your computer and use it in GitHub Desktop.
Simple Example of using Comet to collect some data
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