Add convenience ctor to TextArea

This commit is contained in:
Frank A. Krueger 2017-06-15 23:21:20 -07:00
parent 09043e80b9
commit 2ee084be62
1 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@ using System;
namespace Ooui namespace Ooui
{ {
public class TextArea : Element public class TextArea : FormControl
{ {
public event EventHandler Changed { public event EventHandler Changed {
add => AddEventListener ("change", value); add => AddEventListener ("change", value);
@ -12,7 +12,7 @@ namespace Ooui
string text = ""; string text = "";
public override string Text { public override string Text {
get => text; get => text;
set => SetProperty (ref text, value, "value"); set => SetProperty (ref text, value ?? "", "value");
} }
int rows = 2; int rows = 2;
@ -31,5 +31,11 @@ namespace Ooui
: base ("textarea") : base ("textarea")
{ {
} }
public TextArea (string text)
: this ()
{
Text = text;
}
} }
} }