WPF/XAML: How to make all text upper case in TextBlock?

feralbino picture feralbino · Jul 25, 2014 · Viewed 27.4k times · Source

I want all characters in a TextBlock to be displayed in uppercase

<TextBlock Name="tbAbc"
           FontSize="12"
           TextAlignment="Center"
           Text="Channel Name"
           Foreground="{DynamicResource {x:Static r:RibbonSkinResources.RibbonGroupLabelFontColorBrushKey}}" />

The strings are taken through Binding. I don't want to make the strings uppercase in the dictionary itself.

Answer

TheEye picture TheEye · Feb 4, 2015

Or use

Typography.Capitals="AllSmallCaps"

in your TextBlock definition.

See here: MSDN - Typography.Capitals

EDIT:

This does not work in Windows Phone 8.1, only in Windows 8.1 ...