2017-06-18 23:50:22 +00:00
|
|
|
using System;
|
2017-06-24 20:34:47 +00:00
|
|
|
using System.Collections.Generic;
|
2017-06-18 23:50:22 +00:00
|
|
|
using Ooui;
|
|
|
|
|
|
|
|
namespace Samples
|
|
|
|
{
|
|
|
|
public class TodoSample
|
|
|
|
{
|
2017-06-24 20:34:47 +00:00
|
|
|
|
|
|
|
Element MakeTodo ()
|
2017-06-18 23:50:22 +00:00
|
|
|
{
|
2017-06-24 20:34:47 +00:00
|
|
|
var items = new List ();
|
|
|
|
var input = new Input ();
|
|
|
|
var button = new Button ("Add the item");
|
2017-06-18 23:50:22 +00:00
|
|
|
button.Clicked += (s, e) => {
|
2017-06-24 20:34:47 +00:00
|
|
|
items.AppendChild (new ListItem {
|
|
|
|
Text = input.Value
|
|
|
|
});
|
2017-06-18 23:50:22 +00:00
|
|
|
};
|
2017-06-24 20:34:47 +00:00
|
|
|
var app = new Div ();
|
|
|
|
app.AppendChild (input);
|
|
|
|
app.AppendChild (button);
|
|
|
|
app.AppendChild (items);
|
|
|
|
return app;
|
2017-06-18 23:50:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Publish ()
|
|
|
|
{
|
|
|
|
var b = MakeTodo ();
|
|
|
|
|
|
|
|
UI.Publish ("/todo", MakeTodo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|