Try this
<Button CommandParameter="{x:Static local:SearchPageType.First}" .../>
local
- is your namespace reference in the XAML
Also remember that if your enum is inside another class you need to use the +
operator.
<Button CommandParameter="{x:Static local:MyOuterType+SearchPageType.First}".../>
You can use property element syntax instead of attribute syntax for this:
<Button x:Name="uxSearchButton"
Command="{Binding Path=SearchMembersCommand}"
Content="Search">
<Button.CommandParameter>
<SearchPageType>First</SearchPageType>
</Button.CommandParameter>
</Button>
Also if you want to provide a [Flags
] enum you can use the property element syntax:
<Button>
<Button.CommandParameter>
<SearchPageType>First,Second</SearchPageType>
<Button.CommandParameter>
</Button>
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