I am trying to style text on a page that contains TextBlocks and TextBlocks as the content of CheckBoxes
I want to do something like this (where textBlock is the TextBlock contained within the CheckBox - or anything that inherits from System.Windows.Controls.Control)
textBlock.Inlines.Add("unstyledText");
textBlock.Inlines.Add(new Run { Text = "yellowBoldText ", Foreground = new SolidColorBrush(Colors.Yellow), FontWeight = FontWeights.Bold });
textBlock.Inlines.Add("unstyledText");
This works on the TextBlocks that are not inside a CheckBox. If they are inside a CheckBox, the TextBlock's Text property will change (ie. textBlock.Text == "unstyledText yellowBoldText unstyledText"
returns true), but the text in the CheckBox will not visually change.
Is there anyway to get the TextBlocks inside a CheckBox to behave the same way as the other TextBlocks?