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

DataTriggerBehavior doesn't support enum comparison #84

Open
vborovikov opened this issue Feb 19, 2016 · 3 comments · May be fixed by #157
Open

DataTriggerBehavior doesn't support enum comparison #84

vborovikov opened this issue Feb 19, 2016 · 3 comments · May be fixed by #157

Comments

@vborovikov
Copy link

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.

@adamhewitt627
Copy link

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.

@EddyHaigh
Copy link

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.

@bogdan-patraucean
Copy link

bogdan-patraucean commented Mar 4, 2022

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.

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

Successfully merging a pull request may close this issue.

4 participants