Add convenience constructors
This commit is contained in:
parent
6914ccbc86
commit
8fe076b29c
|
@ -22,6 +22,12 @@ namespace Ooui
|
|||
{
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public Button (string text, TargetEventHandler clickHandler)
|
||||
: this (text)
|
||||
{
|
||||
Click += clickHandler;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonConverter (typeof (StringEnumConverter))]
|
||||
|
|
10
Ooui/Div.cs
10
Ooui/Div.cs
|
@ -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) {
|
||||
|
|
|
@ -8,5 +8,11 @@ namespace Ooui
|
|||
: base ("li")
|
||||
{
|
||||
}
|
||||
|
||||
public ListItem (string text)
|
||||
: this ()
|
||||
{
|
||||
Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue