For one, all my Page View Models now inherit from an IPage View Model interface so they can have some common properties, such as a Name.I also created a new Home View Model and Home View since its hard to demonstrate navigation unless you have at least 2 pages.🙂 No, you are not lost in your path to enlightenment. More specifically, you are binding to a collection of Person objects (namely an Observable Collection) that, in turn, implements the IList interface.The binding engine will automatically generate a List Collection View for such a collection.An added advantage to having a View Model to control the application state is that it can also be used to handle other application-wide objects, such as Current User, or Error Messages.I also need an Application View for my Application View Model.Here is what the List Box declaration might look like: The image below depicts our List Box with grouping and sorting.You can download the sample for this post to see the complete item template, item container style, and group item style.
By default, if WPF encounters an object in it’s visual tree that it doesn’t know how to handle, it will draw it using a Text Block containing the . By defining a Data Template, I am telling WPF to use a specific template instead of defaulting to a Text Block.
A List Collection View will *not* monitor changes to properties on each existing item within the collection.
For example, if you execute code at runtime to dynamically change Bart’s name to “Mandy”, the List Collection View will be unaware of that change and the item will update its view of the items.
The List Collection View class provides support for sorting, grouping, and filtering your collection when it is the Items Source for an Items Control.
(See When this Collection View Source is set as the Items Source of a List Box, it will yield a view of the collection (namely, a List Collection View) in which the characters are grouped by gender and sorted by first name.