Note that there are some explanatory texts on larger screens.

plurals
  1. POImages inside RichTextBlock get hidden randomly
    text
    copied!<p>I have a Silverlight 5 NavigationApplication with a RichTextBlock and TreeView. every time one of TreeView items clicked, i add some images into RichTextBlock using code-behind. the problem is that sometimes when TreeView's SelectedItem is changed, some of added images dont appear inside RichTextBlock. but when i change TreeView's SelectedItem several times, the image appear again! i thought that was because of images caching then tried with using no cache for images, but it's the same. my code for loading images at runtime is this:</p> <pre><code>var uri = new Uri(imageSource, UriKind.Relative); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; bitmapImage.UriSource = uri; bitmapImage.ImageFailed += image_ImageFailed; bitmapImage.ImageOpened += image_ImageOpened; var border = new Border() { Width = 500, Height = 400 }; var image = new Image() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Source = bitmapImage }; border.Child = image; paragraph.Inlines.Add(new InlineUIContainer() { Child = border }); </code></pre> <p>If i leave <code>BitmapCreationOption</code> to it's default value, every image just appears one time and if i click back that TreeViewItem again, no images will be appear at all!<br> I have tried creating images in different size but there was no change, and also i tested loading images from absolute Uri too, but that was not helpful.<br> I am going to think about a bug in RichTextBlock! what do you think guys? </p>
 

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