private void Append() { // create header as html var headerHtml = new HtmlDocument(); var domain = new Uri(BookmarkViewModel.Url).Host; headerHtml.LoadHtml(string.Format("<h2>{0}</h2><p>{1}</p>", BookmarkViewModel.Title, domain)); _textBoxes = new List <RichTextBox>(); _itemsControl.Items.Clear(); AddTextBox(null, topMargin: 15, bottomMargin: 0); AddParagraph(); AppendSpan(headerHtml.DocumentNode.ChildNodes[0], _currentParagraph, null, "title"); AddTextBox(null, bottomMargin: 0); AddParagraph(); AppendSpan(headerHtml.DocumentNode.ChildNodes[1], _currentParagraph, null, "p"); //RenderBody(headerHtml.DocumentNode); var bodyHtml = new HtmlDocument(); var body = BookmarkViewModel.GetBodyFromStorage(); body = StripWhitespaceFromBody(body); bodyHtml.LoadHtml(body); RenderBody(bodyHtml.DocumentNode); }
private void AppendBody() { var html = new HtmlDocument(); var domain = new Uri(BookmarkViewModel.Url).Host; html.LoadHtml(string.Format("<div><h1>{0}</h1><p>{1}</p></div>", BookmarkViewModel.Title, domain)); textBoxes = new List <RichTextBox>(); internalItemsControl.Items.Clear(); AppendRichtextBox(html.DocumentNode); AppendHtml(BookmarkViewModel.GetBodyFromStorage()); }