Data binding to enumeration collections

We've already seen a number of examples of data binding to enumeration instances. We've seen converters that we can use to convert our enumeration values and Extension methods that we can use to extract additional information from each member. Earlier in this chapter, we even saw a full but basic example using our BitRate enumeration. Now, with our new-found knowledge, let's see how we can improve that earlier example.

As noted, in the previous example, we manually declared a RadioButton control for each of our enumerations. While that is fine for our three member enumeration, it wouldn't make so much sense to use this method if we had a large number of members. Instead, let's think about how we could use ...

Get Mastering Windows Presentation Foundation 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.