Pages

Monday, 2 February 2009

Passing an Enum as a CommandParameter

We wanted to pass an Enum as a CommandParameter and struggled to find the right syntax. The final result turned out to be straightforward.
xmlns:Util="clr-namespace:Sandstorm.Documents.FlexBlockBookings.Util


<RadioButton Name="rbPriceByActivity"
Content="By Activity"
Command="{Binding Path=BBChangePricingCommand}"
CommandParameter="{x:static Util:PricingOptions.ByActivity}"/>

1 comment:

Unknown said...

How do you set up the command code to receive the commandparameter? I have commands working beautifully, but they don't accept parameters.