Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

x:Static in UWP XAML

An app I'm working on requires a ConverterParameter to be an enum. For this, the regular way to do would be:

{Binding whatever,      Converter={StaticResource converterName},      ConverterParameter={x:Static namespace:Enum.Value}} 

However, the UWP platform x: namespace does not seem to have the Static extension.

Does anyone know if there's a solution that does not rely on x:Static for comparing an enum in binding?

like image 597
fonix232 Avatar asked Aug 12 '15 11:08

fonix232


1 Answers

This works for me in a UWP:

<Button Command="{Binding CheckWeatherCommand}">   <Button.CommandParameter>      <local:WeatherEnum>Cold</local:WeatherEnum>   <Button.CommandParameter> </Button> 
like image 59
user5971245 Avatar answered Sep 18 '22 18:09

user5971245