Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


Set rich text into RichTextBlock control

AddThis Social Bookmark Button
Unless I’m missing something, there’s no direct way to bind XAML-ish text to a WinRT RichTextBlock control. For example, if I have some text like:
    This is some text. And some bolded text.
I would like to just bind this text to a RichTextBlock control for display. Sadly there’s no way to put content into a RichTextBlock control at runtime
short of adding Block objects to the control’s Blocks collection. As a workaround, I’ve been playing with the idea of a custom control like this: using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup; namespace Application11
  public class RichTextDisplay : ContentControl
    public static readonly DependencyProperty XamlProperty =
        DependencyProperty.Register("Xaml", typeof(string), typeof(RichTextDisplay), new PropertyMetadata(null, XamlChanged));     public string Xaml...(Read whole news on source site)

Home : Blog List : Rockford Lhotka : Set rich text into RichTextBlock control