Passing an enum value as command parameter from XAML
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>