How to make all text upper case / capital?
You still can use a converter, just set the textvalue in the source of the binding :
<TextBlock Text="{Binding Source={StaticResource String1}, Converter ={StaticResource myConverter}}"/>
I think this will work for you
<TextBlock Text='{StaticResource String1}' Typography.Capitals="AllPetiteCaps"/>
For font capitals enumerations https://msdn.microsoft.com/en-us/library/system.windows.fontcapitals(v=vs.110).aspx
To complete Peter's answer (my edit has been rejected), you can use a converter like this:
C#:
public class CaseConverter : IValueConverter
{
public CharacterCasing Case { get; set; }
public CaseConverter()
{
Case = CharacterCasing.Upper;
}
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var str = value as string;
if (str != null)
{
switch (Case)
{
case CharacterCasing.Lower:
return str.ToLower();
case CharacterCasing.Normal:
return str;
case CharacterCasing.Upper:
return str.ToUpper();
default:
return str;
}
}
return string.Empty;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
XAML:
<TextBlock Text="{Binding Source={StaticResource String1}, Converter ={StaticResource myCaseConverter}}"/>
Rather than using a converter, you can use the tag CharacterCasing in a TextBox but in your case, it doesn't work on a TextBlock.
<TextBox CharacterCasing="Upper" Text="{StaticResource String1}" />