O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding a collection to a combobox

The list view and grid view are not the only controls that allow you to present a collection of items. The other one shows them in a bit different way, as a drop-down list. This control is named combobox. In this recipe, you will learn how to use the data binding mechanism with this control.

As an example, you will create a page with a combobox that will present a list of available languages of the application. Each item will be presented as a flag next to a language name.

Getting ready

To step through this recipe, you need the automatically generated project configured according to the MVVM design pattern, as described in the Creating the view model for a page recipe.

How to do it...

To bind a collection to a combobox, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required