Ooui-tws-port/Ooui.Wasm/ooui-sample.cs

26 lines
457 B
C#
Raw Normal View History

2018-03-09 23:58:17 +00:00
using System;
using Ooui;
2018-03-10 00:44:10 +00:00
public class Program
{
public static string Main (string a0, string a1)
{
2018-03-09 23:58:17 +00:00
try {
2018-03-10 00:44:10 +00:00
var l = new Label { Text = "Hello" };
var b = new Button ("Click Me");
var e = new Div (new Div (l), b);
2018-03-10 03:11:57 +00:00
var c = 0;
b.Click += (s, ee) => {
b.Text = $"Clicked {c} times";
};
2018-03-10 00:44:10 +00:00
UI.SetGlobalElement ("main", e);
return e.ToString ();
2018-03-09 23:58:17 +00:00
}
catch (Exception e) {
Console.WriteLine (e);
return e.ToString ();
}
}
}