Using OR to Combine Enumerated Values in XAML

Sometimes, you find that you need to use the OR operator to join together a number of values from an enumeration, and assign the result to a property in XAML. The CommandButtonsVisibility property on the DataForm control is a perfect example of this. As you saw in Chapter 7, this property determines what command buttons should be displayed in the data form by using the OR operator to combine the corresponding values from the DataFormCommandButtonsVisibility enumeration. Whereas you might do the following in code:

ProductsDataForm.CommandButtonsVisibility =                         DataFormCommandButtonsVisibility.Add |                         DataFormCommandButtonsVisibility.Delete;

you can achieve ...

Get Pro Business Applications with Silverlight 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.