Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only use equals operator with enum? #58

Open
jamesdebono opened this issue Apr 23, 2019 · 1 comment
Open

Can only use equals operator with enum? #58

jamesdebono opened this issue Apr 23, 2019 · 1 comment

Comments

@jamesdebono
Copy link

I only seem to be able to use the '==' operator for comparing an enum.
Is it possible to use other operators such as '>='?

I tried this:
Visibility="{c:Binding 'CurrentUser.Level>=local:UserLevel.Administrator'}"
And got this error:
Binding error: calc converter can't convert expression{0}>=Enum1.Administrator: The binary operator GreaterThanOrEqual is not defined for the types 'MyNameSpace.UserLevel' and 'MyNameSpace.UserLevel'.

Using the equals operator is working though.

@keytrap-x86
Copy link

You would have to cast enums to int. This doesn't seem to be supported by CalcBindings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants