WPF Reflections

May 25 2008   10:03PM GMT

WPF DataTriggers with enums

Mark Shurmer Profile: MarkWPF

This is something that I had to do recently, and it wasn’t as obvious as I thought.

Given a very simple enum like:


The first (and obvious) try is:


Here we are trying to hide a label and a textbox based on the value of the enum.
However, it doesn’t work 🙁

As an aside, the autogrid you see heer is very handy, and can be found on www.codeplex.com

What you actually need to do is slightly odd, and is effectively instantiating the enum values:


 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: