Ooui-tws-port/Samples/ButtonSample.cs

30 lines
567 B
C#
Raw Normal View History

2017-06-15 06:38:58 +00:00
using System;
using Ooui;
namespace Samples
{
public class ButtonSample
{
Button MakeButton ()
{
2017-06-16 23:02:38 +00:00
var button = new Button ("Click me!");
2017-06-15 06:38:58 +00:00
var count = 0;
button.Clicked += (s, e) => {
count++;
button.Text = $"Clicked {count} times";
};
return button;
}
public void Publish ()
{
var b = MakeButton ();
UI.Publish ("/shared-button", b);
UI.Publish ("/button", MakeButton);
}
}
}