Using enum in ConverterParameter
ArsenMkrt's answer is correct,
Another way of doing this is to use the x:Static
syntax in the ConverterParameter
<Button ...
Visibility="{Binding Path=CurrentAuthenticationLevel,
Converter={StaticResource AuthenticationToVisibility},
ConverterParameter={x:Static local:AuthenticationEnum.Administrator}}"/>
And in the converter
public class AuthenticationToVisibility : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
AuthenticationEnum authenticationEnum = (AuthenticationEnum)parameter;
//...
}
}
User
(AuthenticationEnum)Enum.Parse(typeof(AuthenticationEnum),parameter)
to parse string as enumerator