Created
June 6, 2021 17:26
-
-
Save praeclarum/1c1d68e1d973609012982e87f9642356 to your computer and use it in GitHub Desktop.
Minimal Ooui application
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
using System; | |
using Ooui; | |
namespace MinimalOoui | |
{ | |
class Program | |
{ | |
static Element CreateUI() | |
{ | |
var button = new Button("Click me!"); | |
var statusText = new Span(); | |
statusText.Style.Display = "block"; | |
button.Click += (s, e) => { | |
statusText.Text += "Hello chat room! "; | |
}; | |
var form = new Div(); | |
form.AppendChild(statusText); | |
form.AppendChild(button); | |
return form; | |
} | |
static void Main(string[] args) | |
{ | |
System.Console.WriteLine("Starting Ooui app"); | |
UI.Publish("/", _ => CreateUI()); | |
UI.Present("/"); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment