Added Form

This commit is contained in:
Frank A. Krueger 2017-06-15 23:35:58 -07:00
parent fa13b0948e
commit 1c833b7521
2 changed files with 27 additions and 0 deletions

17
Ooui/Form.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
namespace Ooui
{
public class Form : Element
{
public event EventHandler Submitted {
add => AddEventListener ("submit", value);
remove => RemoveEventListener ("submit", value);
}
public Form ()
: base ("form")
{
}
}
}

View File

@ -16,6 +16,16 @@ namespace Ooui
set => SetProperty (ref isDisabled, value, "disabled");
}
public Form Form {
get {
var p = ParentNode;
while (p != null && !(p is Form)) {
p = p.ParentNode;
}
return p as Form;
}
}
public FormControl (string tagName)
: base (tagName)
{