Created
January 9, 2018 15:06
-
-
Save kevingosse/5d28d8954fb58f0ed0d9129863c604fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int index = 0; | |
foreach (Match match in matches) | |
{ | |
paragraph.Inlines.Add(new Run(System.Net.WebUtility.HtmlDecode(content.Substring(index, match.Index - index)))); | |
var hyperLink = new Hyperlink(new Run(match.Groups["label"].Value)); | |
var command = match.Groups["command"].Value; | |
hyperLink.Command = new DmlCommand(() => _ = ExecuteCommand(command)); | |
paragraph.Inlines.Add(hyperLink); | |
index = match.Index + match.Length; | |
} | |
if (index < content.Length) | |
{ | |
paragraph.Inlines.Add(new Run(System.Net.WebUtility.HtmlDecode(content.Substring(index)))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment