Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using the RadRichTextBox from Telerik which lets you render pretty much any type of document.</p> <p>Herzmeister, thanks a lot for your answer, after looking at the code of the HTMLTextBlock you suggested I could come up with a solution.. here's the code I used..</p> <blockquote> <p>.xaml</p> </blockquote> <pre><code>&lt;UserControl x:Class="RadControlsSample.RadRichTextBoxTest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:telerikHtml="clr-namespace:Telerik.Windows.Documents.FormatProviders.Html;assembly=Telerik.Windows.Documents.FormatProviders.Html" mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="400" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Loaded="Example_Loaded"&gt; &lt;Grid x:Name="LayoutRoot"&gt; &lt;telerik:RadRichTextBox Grid.Row="1" x:Name="richTextBox" DataContext="{Binding}" IsReadOnly="True" ShowMergeFieldsHighlight="False" IsSpellCheckingEnabled="False" /&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre> <blockquote> <p>.cs</p> </blockquote> <pre><code>using System; using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Resources; using Telerik.Windows.Documents.FormatProviders.Html; using Telerik.Windows.Documents.Model; namespace RadControlsSample { public partial class RadRichTextBoxTest : UserControl { private const string SampleDocumentPath = "SampleData/SomeHtml.html"; public RadRichTextBoxTest() { InitializeComponent(); } private void Example_Loaded(object sender, RoutedEventArgs e) { //Load html file from the content file var fileUri = new Uri(SampleDocumentPath, UriKind.Relative); StreamResourceInfo streamInfo = System.Windows.Application.GetResourceStream(fileUri); var reader = new StreamReader(streamInfo.Stream); this.richTextBox.Document = new HtmlFormatProvider().Import(reader.ReadToEnd()); this.richTextBox.Document.LayoutMode = DocumentLayoutMode.Flow; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload