2

I am developing application on Windows Phone 8.1. I am using RichTextBlock to display rich content: text, images, hyperlinks.

Here is how to create image for rich text block:

new InlineUIContainer
{
    Child = new Image
    {
        Source = new BitmapImage(new Uri("http://img.jpg", UriKind.Absolute))
    }
};

I tried to create hyperlink with image inside like that:

hyperlink.Inlines.Add(CreateImageInlineUIContainer(...));

This line of code throws an exception:

ArgumentException: A first chance exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll
Additional information: Value does not fall within the expected range.

Am I missing something? Are there any other ways to add hyperlink with image to a RichTextBlock?

Andrei
  • 42,814
  • 35
  • 154
  • 218

0 Answers0