Colorize the FlowDocument
I am using C # 3.0 and I have the following FlowDocument:
var doc = new FlowDocument();
var p = new Paragraph();
p.Inlines.Add(new Run("Hello 777 world 777"));
doc.Blocks.Add(p);
How can I wrap all substrings of "777" with Hyperlink software? I need to get a document where all "777s" are hyperlinks.
+2
Fefor33
source
to share
1 answer
It may be old, but for people who will have the same problem.
var doc = new FlowDocument();
var p = new Paragraph();
p.Inlines.Add(new Run("Hello "));
p.Inlines.Add(new Hyperlink(new Run("777")));
p.Inlines.Add(new Run(" world "));
p.Inlines.Add(new Hyperlink(new Run("777")));
doc.Blocks.Add(p);
+1
source to share