The Problem: You need to conditionally bold text in a text block, but you cannot find any way of doing so
The Cause: For inexplicable reasons, Microsoft chose not to include a FontWeight.Bold in their xaml specification
The Solution: Microsoft did include a FontWeights (note the S) class To bold text in the codebehind, all you have to do is write this
tbbDownloader.FontWeight = FontWeights.Bold;
And presto! Bold Text.
This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog
|
Written By Steve French |
[…] This post was mentioned on Twitter by Larry King, Steve French. Steve French said: Just Blogged: Silverlight Tip – How to make bold text in a textblock from the CodeBehind http://su.pr/8BIVNi #Silverlight #HowToFix […]
Nice dispatch and this enter helped me alot in my college assignement. Say thank you you for your information.