private void SetContentElement()
        {
            Bridge.Html5.HTMLElement htmlElement;

            if (IsPassword || !AcceptsReturn)
            {
                htmlElement = Bridge.Html5.Document.CreateElement("input");
                htmlElement.SetAttribute("type", IsPassword ? "password" : "text");
            }
            else
            {
                htmlElement = Bridge.Html5.Document.CreateElement("textArea");
            }

            ContentElement = new HtmlRenderElement(htmlElement);

            SetContentElementText();
            SetContentElementMaxLength();
            SetContentElementSelectionStart();
            SetContentElementSelectionLength();
            SetContentElementIsReadOnly();
            SetContentElementSpellCheck();
            SetContentElementTextWrapping();

            ContentElement.HtmlElement.SetHtmlStyleProperty("resize", "none");
            ContentElement.HtmlElement.SetHtmlStyleProperty("margin", "0px");
            ContentElement.HtmlElement.SetHtmlStyleProperty("padding", "0px");
            ContentElement.HtmlElement.SetHtmlStyleProperty("border", "0px solid transparent");
            ContentElement.HtmlElement.SetHtmlStyleProperty("outline", "1px solid transparent");
            ContentElement.HtmlElement.SetHtmlStyleProperty("cursor", "inherit");
            ContentElement.HtmlElement.SetHtmlBackground(Brushes.Transparent, System.Windows.Rect.Zero, factory, converter);
            ContentElement.HtmlElement.SetHtmlLocation(Point.Zero, converter);

            ContentElement.HtmlElement.SetHtmlSize(Bounds.Size, converter);
            ContentElement.HtmlElement.SetHtmlForeground(Foreground, converter);
            ContentElement.HtmlElement.SetHtmlFontFamily(FontFamily, converter);
            ContentElement.HtmlElement.SetHtmlFontSize(FontSize, converter);
            ContentElement.HtmlElement.SetHtmlFontStyle(FontStyle, converter);
            ContentElement.HtmlElement.SetHtmlFontWeight(FontWeight, converter);
            ContentElement.HtmlElement.SetHtmlFontStretch(FontStretch, converter);
            ContentElement.HtmlElement.SetHtmlIsHitTestVisible(IsHitTestVisible);
            ContentElement.HtmlElement.SetHtmlTextAlignment(TextAlignment, converter);
            ContentElement.HtmlElement.SetHtmlTextTrimming(TextTrimming);
            ContentElement.HtmlElement.SetHtmlHorizontalScrollBarVisibility(HorizontalScrollBarVisibility, converter);
            ContentElement.HtmlElement.SetHtmlVerticalScrollBarVisibility(VerticalScrollBarVisibility, converter);

            ContentElement.HtmlElement.OnInput   += e => this.Text = ContentElement.HtmlElement.GetValue();
            ContentElement.HtmlElement.OnKeyDown += OnContentElementKeyDown;
            ContentElement.HtmlElement.OnSelect  += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnKeyUp   += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnMouseUp += e => GetContentElementSelection();
        }
        private void SetContentElement()
        {
            if (IsPassword || !AcceptsReturn)
            {
                ContentElement = new HtmlRenderElement("input", renderQueue);
                ContentElement.HtmlElement.SetAttribute("type", IsPassword ? "password" : "text");
            }
            else
            {
                ContentElement = new HtmlRenderElement("textarea", renderQueue);
            }

            SetContentElementText();
            SetContentElementMaxLength();
            SetContentElementSelectionStart();
            SetContentElementSelectionLength();
            SetContentElementIsReadOnly();
            SetContentElementSpellCheck();
            SetContentElementTextWrapping();

            ContentElement.Style.SetValue("resize", "none");
            ContentElement.Style.SetValue("margin", "0px");
            ContentElement.Style.SetValue("padding", "0px");
            ContentElement.Style.SetValue("border", "0px solid transparent");
            ContentElement.Style.SetValue("outline", "1px solid transparent");
            ContentElement.Style.SetValue("cursor", "inherit");
            ContentElement.Style.SetBackground(Brushes.Transparent, converter);
            ContentElement.Style.SetLocation(Point.Zero, converter);

            ContentElement.Style.SetSize(Bounds.Size, converter);
            ContentElement.Style.SetForeground(Foreground, converter);
            ContentElement.Style.SetFontFamily(FontFamily, converter);
            ContentElement.Style.SetFontSize(FontSize, converter);
            ContentElement.Style.SetFontStyle(FontStyle, converter);
            ContentElement.Style.SetFontWeight(FontWeight, converter);
            ContentElement.Style.SetFontStretch(FontStretch, converter);
            ContentElement.Style.SetIsHitTestVisible(IsHitTestVisible);
            ContentElement.Style.SetTextAlignment(TextAlignment, converter);
            ContentElement.Style.SetTextTrimming(TextTrimming);
            ContentElement.Style.SetHorizontalScrollBarVisibility(HorizontalScrollBarVisibility, converter);
            ContentElement.Style.SetVerticalScrollBarVisibility(VerticalScrollBarVisibility, converter);

            ContentElement.HtmlElement.OnInput   += e => this.Text = ContentElement.HtmlElement.GetValue();
            ContentElement.HtmlElement.OnKeydown += OnContentElementKeyDown;
            ContentElement.HtmlElement.OnSelect  += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnKeyup   += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnMouseup += e => GetContentElementSelection();
        }
        private void SetContentElement()
        {
            if (IsPassword || !AcceptsReturn)
            {
                ContentElement = new HtmlRenderElement("input", renderQueue);
                ContentElement.HtmlElement.SetAttribute("type", IsPassword ? "password" : "text");
            }
            else
            {
                ContentElement = new HtmlRenderElement("textarea", renderQueue);
            }

            SetContentElementText();
            SetContentElementMaxLength();
            SetContentElementSelectionStart();
            SetContentElementSelectionLength();
            SetContentElementIsReadOnly();
            SetContentElementSpellCheck();
            SetContentElementTextWrapping();

            ContentElement.Style.SetValue("resize", "none");
            ContentElement.Style.SetValue("margin", "0px");
            ContentElement.Style.SetValue("padding", "0px");
            ContentElement.Style.SetValue("border", "0px solid transparent");
            ContentElement.Style.SetValue("outline", "1px solid transparent");
            ContentElement.Style.SetValue("cursor", "inherit");
            ContentElement.Style.SetBackground(Brushes.Transparent, converter);
            ContentElement.Style.SetLocation(Point.Zero, converter);

            ContentElement.Style.SetSize(Bounds.Size, converter);
            ContentElement.Style.SetForeground(Foreground, converter);
            ContentElement.Style.SetFontFamily(FontFamily, converter);
            ContentElement.Style.SetFontSize(FontSize, converter);
            ContentElement.Style.SetFontStyle(FontStyle, converter);
            ContentElement.Style.SetFontWeight(FontWeight, converter);
            ContentElement.Style.SetFontStretch(FontStretch, converter);
            ContentElement.Style.SetIsHitTestVisible(IsHitTestVisible);
            ContentElement.Style.SetTextAlignment(TextAlignment, converter);
            ContentElement.Style.SetTextTrimming(TextTrimming);
            ContentElement.Style.SetHorizontalScrollBarVisibility(HorizontalScrollBarVisibility, converter);
            ContentElement.Style.SetVerticalScrollBarVisibility(VerticalScrollBarVisibility, converter);

            ContentElement.HtmlElement.OnInput += e => this.Text = ContentElement.HtmlElement.GetValue();
            ContentElement.HtmlElement.OnKeydown += OnContentElementKeyDown;
            ContentElement.HtmlElement.OnSelect += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnKeyup += e => GetContentElementSelection();
            ContentElement.HtmlElement.OnMouseup += e => GetContentElementSelection();
        }