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.
Be the first to like this post.
Yes, it was very helpful for us, thanks to share this tip…