Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:36:35+00:00 2026-05-16T18:36:35+00:00

I am using Microsoft’s XAML/HTML converter to convert HTML from a database into a

  • 0

I am using Microsoft’s XAML/HTML converter to convert HTML from a database into a XAML string. The Microsoft converter seems to be formatting the text correctly, but I’m having trouble binding the output to a XAML object.

For example, using the following HTML:

<span style="font-weight: bold; font-family: Georgia; color: rgb(0, 96, 144); text-decoration: underline;">Hello world.</span>

I will get the XAML output:

<Section xml:space="preserve" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Paragraph>
    <Run FontWeight="bold" TextDecorations="Underline" FontFamily="georgia">Hello world.</Run>
</Paragraph>

Assuming the HTML is coming into the WPF application as the “Text” property of a database object, I then use Binding and Converters like so:

<TextBlock Text="{Binding Path=ActiveDataItem.Text, Converter={StaticResource convertHTMLToXaml}}" />

Unfortunately, this just prints the XAML to the page and doesn’t parse it. I’m assuming this is because I’m binding to the TextBlock and that’s the expected outcome. My question is how do I bind this output a FlowDocument related control like a Paragraph, Run, Section, or whatever?

Note: I realize there a quite a few threads dedicated to converting HTML to XAML. I have referenced most of them, but they are all lacking on this specific step. Any help or links are appreciated, thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:36:35+00:00Added an answer on May 16, 2026 at 6:36 pm

    For your example, you have the xaml as text and bound to the Text-property. This only shows the xaml as text.

    If there is a direct way to bind it as the content of a FlowDocument, I don’t known. IMO this is not possible due to the structure of FlowDocument. But maybe someone knows a way and posts you a solution for this.

    To do it manually, look at the example of this page (dead link, see Archive.org). There I have seen that the author loads a XAML-string into a RichTextBox. You can change the code to your needs (RichtTextBox works also with FlowDocs). Search for public static class RichTextboxAssistant, there is the code your looking for. Take care for the encoding. He uses ASCII. Maybe you have to change this to UTF.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using Microsoft office automation I want to insert images into a spreadsheet. How
Using Microsoft SQL 2008. I have two tables that I want to select from
I'm using Microsoft Expression Blend 4 I have a Browser .., [ XAML ]
Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters?
Using Microsoft FCIV which computes SHA-1 file checksums, I created a text file with
Using Microsoft SQL 2008 I have a loop that should grab data from each
I'm using Microsoft.XMLHTTP to get some information from another server from an old ASP/VBScript
I'm using Microsoft.Office.Interop.Excel to write data into excel cell. The cell has a certain
Using Microsoft SQL Server 2005, is there any way to see when a table
Using Microsoft SQL Server... declare @x xml set @x = '<Example>&lt;You &amp; Me&gt;</Example>' select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.