Open vborovikov opened 8 years ago
Same here. I've worked around it for now with a value converter to get the enum to a string (matching the value name) and then setting Value="EnumsStringValue"
. It'd be nice for the framework to handle it and get the compile checking.
Is this going to get fixed? The PR has been in since 2019 and I'm hitting the same issue on WinUI 3 with behaviors.
I encountered the same issue:
This works:
Binding="{x:Bind Color.ToString(), Mode=OneWay}" ComparisonCondition="Equal" Value="{x:Bind local:LabelColor.LightGreen.ToString(), Mode=OneWay}"
This doesn't:
Binding="{x:Bind Color, Mode=OneWay}" ComparisonCondition="Equal" Value="{x:Bind local:LabelColor.LightGreen, Mode=OneWay}"
The only difference is the ToString, this looks like a simple problem to solve, I don't know why such a basic feature is not yet fully supported.
It seems that binding DataTriggerBehavior to enum property on a viewmodel doesn't work and breaks other bindings in page/usercontrol too.
I'm trying to bind DataTriggerBehavior to an enum property on a viewmodel and compare it to a string representation of the enum value.