From 2ee084be624cb61d744c0ed80069b496061b0684 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Thu, 15 Jun 2017 23:21:20 -0700 Subject: [PATCH] Add convenience ctor to TextArea --- Ooui/TextArea.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Ooui/TextArea.cs b/Ooui/TextArea.cs index 194cc9c..a3dab38 100644 --- a/Ooui/TextArea.cs +++ b/Ooui/TextArea.cs @@ -2,7 +2,7 @@ using System; namespace Ooui { - public class TextArea : Element + public class TextArea : FormControl { public event EventHandler Changed { add => AddEventListener ("change", value); @@ -12,7 +12,7 @@ namespace Ooui string text = ""; public override string Text { get => text; - set => SetProperty (ref text, value, "value"); + set => SetProperty (ref text, value ?? "", "value"); } int rows = 2; @@ -31,5 +31,11 @@ namespace Ooui : base ("textarea") { } + + public TextArea (string text) + : this () + { + Text = text; + } } }