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.

Advertisement

Tagged: ,

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

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

What’s this?

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

meta

Follow

Get every new post delivered to your Inbox.