I'm trying to add inlines to a text block using the code below. The text block's window uses a Themes.xaml
file for styling, but when I add the runs dynamically, the styling does not get applied. Can you help me understand why?
foreach (string key in wrappingOptions.Keys)
{
Hyperlink link = new Hyperlink(new Run(key));
string s = new string(wrappingOptions[key].ToCharArray());
link.Click += (o, _) => tbIn.SelectedText = string.Format("<{0}>{1}</{0}>",
s, tbIn.SelectedText);
InputLinksBlock.Inlines.Add(link);
}