How to set a converter for a static property? The following example shows my problem – I would like to convert a TextBlock
text to upper case.
<UserControl x:Class="CoRiMaCorporate.HomeScreen.Controls.Home.ConfigurationControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mainResources="clr-namespace:MainSharedResources;assembly=MainSharedResources"
xmlns:converters="clr-namespace:CommonClientLibrary.Converters;assembly=CommonClientLibrary" />
<UserControl.Resource>
<converters:StringToUpperCaseStringConverter x:Key="stringToUpperCaseStringConverter" />
</UserControl.Resource>
<Grid>
…
<TextBlock Text="{x:Static mainResources:Lang.Applications}" />
…
</Grid>
I looking for something like this:
<TextBlock Text="{Binding Converter=stringToUpperCaseStringConverter, ConverterParameter={x:Static mainResources:Lang.Applications}}" />
static property goes to binding Source, converter provided by StaticResource
<TextBlock Text="{Binding Converter={StaticResource stringToUpperCaseStringConverter},
Source={x:Static mainResources:Lang.Applications}}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With