-
-
Save AlexHedley/83668cd8b616e6c49f73b14d590d891d to your computer and use it in GitHub Desktop.
Minimal Ooui application
This file contains hidden or 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