Tuesday, August 25, 2009

ItemsControl not showing items

This is simple but easy to forget.

To get data bound to WPF controls you frequently use its DataContext. That works for an ItemsControl but what you probably want is ItemSource instead of DataContext. ItemSource will display a collection whereas DataContext only gives you the first item.

No comments: