It is better to do this in XAML as follows:
<TextBlock>
The <Bold>Quick</Bold> Brown <Bold>Fox</Bold>
</TextBlock>
But you can also do this in code through a Inlinesproperty TextBlock:
someTextBlock.Inlines.Add(new Run() { Text = "The " });
someTextBlock.Inlines.Add(new Run() { Text = "Quick ", FontWeight = FontWeights.Bold });
someTextBlock.Inlines.Add(new Run() { Text = "Brown " });
someTextBlock.Inlines.Add(new Run() { Text = "Fox", FontWeight = FontWeights.Bold });
source
share