![]() However, using TextBlock in a RichTextBlock where the user can make changes is a great suggestion. ![]() When the RichTextBox is readonly, it is not necessary to put the HyperLink into a TextBlock. I wanted the RichTextBox to be readonly.My answer is based on answer, which I wanted to extend with the event handler code, which I had some difficulties to get it working. This gets me the behavior I want (shoving plain strings into RichTextBox and getting formatting) and it also results in links that behave like a normal link, rather than one that's embedded in a Word document. TextLink.NavigateUri = new Uri(textSplit) Hyperlink textLink = new Hyperlink(new Run(textSplit)) What's relevant to the question, is that I have an IValueConverter Convert() overload that looks something like this (code non-essential to the solution has been stripped out): FlowDocument doc = new FlowDocument() I have subclassed the RichTextBox to allow binding against it's Document property. ![]() The content that's loaded into my RichTextBox is just stored (or inputted) as a plain string. Managed to find a way around this, pretty much by accident. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |