In the application I'm currently developing for, we are using the the WPF RadRichTextBox as an Html editor, in which documents are synced to a server and accessed from many different computers.
In order to handle embedded images (ImageInlines), we associate each image with a content id number, which is stored on the server. My problem comes into effect when the user downloads a document (along with it's embedded images) from the server, since the content id number is stored in place of the src attribute on the Html <image> tag. The Telerik control parses the image tag fine, and simple displays an image placeholder due to the content id being an invalid path, so I loop through the Document's ImageInlines and replace the src attribute with a proper filepath:
The problem then is that the RichTextBox control doesn't seem to update to show the image at the given path (even though I have verified, by exporting and inspecting the Html, that the src attribute points to a valid image file). Is there some sort of "force update" that I need to perform, or perhaps a step I'm missing? Or is there possibly just a better way of doing something along these lines?
Thanks,
Chris Covert
In order to handle embedded images (ImageInlines), we associate each image with a content id number, which is stored on the server. My problem comes into effect when the user downloads a document (along with it's embedded images) from the server, since the content id number is stored in place of the src attribute on the Html <image> tag. The Telerik control parses the image tag fine, and simple displays an image placeholder due to the content id being an invalid path, so I loop through the Document's ImageInlines and replace the src attribute with a proper filepath:
IEnumerable<ImageInline> inlines = document.EnumerateChildrenOfType<ImageInline>();
foreach
(ImageInline image
in
inlines)
{
image.UriSource =
new
Uri(GetLocalPath(image.UriSource.AbsolutePath);
}
The problem then is that the RichTextBox control doesn't seem to update to show the image at the given path (even though I have verified, by exporting and inspecting the Html, that the src attribute points to a valid image file). Is there some sort of "force update" that I need to perform, or perhaps a step I'm missing? Or is there possibly just a better way of doing something along these lines?
Thanks,
Chris Covert