How to set multiple enum members (flags) in XAML

September 18th, 2009 § 1 Comment

I was dealing with the DataForm control and I wanted to show multiple command buttons through the CommandButtonsVisibility property. CommandButtonsVisibility is enum. While it was perfectly clear how to do this in code (

dataForm.CommandButtonsVisibility =
	DataFormCommandButtonsVisibility.Add |
	DataFormCommandButtonsVisibility.Cancel |
	DataFormCommandButtonsVisibility.Edit;

), that wasn’t the case with XAML.

I tried to apply the same technique in XAML, but with no luck. Turns out it is even easier to set this in XAML:

CommandButtonsVisibility="Add,Cancel,Edit"

That’s just a little tip that I thought it’d be useful to share.

Tagged: .NET RIA Services, XAML

Be the first to like this post.

§ One Response to How to set multiple enum members (flags) in XAML

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What’s this?

You are currently reading How to set multiple enum members (flags) in XAML at Emil Stoychev.

meta