Add convenience constructors

This commit is contained in:
Frank A. Krueger 2020-03-08 17:32:49 -07:00
parent 6914ccbc86
commit 8fe076b29c
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
3 changed files with 21 additions and 1 deletions

View File

@ -22,6 +22,12 @@ namespace Ooui
{
Text = text;
}
public Button (string text, TargetEventHandler clickHandler)
: this (text)
{
Click += clickHandler;
}
}
[JsonConverter (typeof (StringEnumConverter))]

View File

@ -12,7 +12,15 @@ namespace Ooui
{
}
public Div (params Element[] children)
public Div (params Node[] children)
: this ()
{
foreach (var c in children) {
AppendChild (c);
}
}
public Div (IEnumerable<Node> children)
: this ()
{
foreach (var c in children) {

View File

@ -8,5 +8,11 @@ namespace Ooui
: base ("li")
{
}
public ListItem (string text)
: this ()
{
Text = text;
}
}
}