开发者

Is it possible to have url reference of an image in xaml like html?

开发者 https://www.devze.com 2023-03-19 02:04 出处:网络
I am working on RichTextBox in WPF and开发者_Go百科 i would like to know if i can have url references something like we have in html

I am working on RichTextBox in WPF and开发者_Go百科 i would like to know if i can have url references something like we have in html

<img src="http://AnyWebsite.com/example.png" />

in xaml ( which i will be converting to rtf and storing it into the DB )

Thank you for your help!


It's possible.

Based on your comment I am editing my earlier answer. This link will help you achieve what you want, you will need to create a custom converter class.

http://blog.davidsandor.com/post/2010/05/12/How-To-WPF-Databind-a-URL-URI-to-an-Image-control.aspx


I would recommend using FlowDocument instead of RichTextBox in this case as you want to display images and text togather.

For details you may refer to the article in msdn

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号