Skip to content

Instantly share code, notes, and snippets.

@praeclarum
Created June 6, 2021 17:26
Show Gist options
  • Save praeclarum/1c1d68e1d973609012982e87f9642356 to your computer and use it in GitHub Desktop.
Save praeclarum/1c1d68e1d973609012982e87f9642356 to your computer and use it in GitHub Desktop.
Minimal Ooui application
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