Alex141 / CalcBinding

Advanced WPF Binding which supports expressions in Path property and other features
Apache License 2.0
626 stars 78 forks source link

Can only use equals operator with enum? #58

Open jamesdebono opened 5 years ago

jamesdebono commented 5 years ago

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 commented 3 years ago

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