Skip to content

Instantly share code, notes, and snippets.

@AlexHedley
Forked from praeclarum/MinimalOoui.cs
Created June 9, 2021 09:22
Show Gist options
  • Select an option

  • Save AlexHedley/83668cd8b616e6c49f73b14d590d891d to your computer and use it in GitHub Desktop.

Select an option

Save AlexHedley/83668cd8b616e6c49f73b14d590d891d 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