Convention for binding Panorama ItemSource

Apr 26, 2011 at 12:13 PM

Is there a convention to bind panorama's ItemSource to a collection? I thinks one needs to be written but i don't really know the convention code well enough at the moment.

Apr 26, 2011 at 1:40 PM

Have a look at the samples....

Apr 26, 2011 at 2:14 PM

Can you point out which one, i can't see it in the WP7 Sample

Apr 26, 2011 at 3:15 PM

It's there in the bootstrapper in the method called AddCustomConventions.

Apr 26, 2011 at 3:48 PM

isn't that just for binding the Header Template and SelectedItem, not the ItemSource?

Apr 26, 2011 at 3:53 PM
Edited Apr 26, 2011 at 3:56 PM

It does four things.

ConventionManager.AddElementConvention<Panorama>(Panorama.ItemsSourceProperty, "SelectedItem", "SelectionChanged").ApplyBinding =
                (viewModelType, path, property, element, convention) => {
                        .GetElementConvention(typeof(ItemsControl)) //ItemsSource and ItemTemplate
                        .ApplyBinding(viewModelType, path, property, element, convention)) {
                            .ConfigureSelectedItem(element, Panorama.SelectedItemProperty, viewModelType, path); //SelectedItem
                            .ApplyHeaderTemplate(element, Panorama.HeaderTemplateProperty, viewModelType); //HeaderTemplate
                        return true;

                    return false;

Apr 27, 2011 at 12:21 PM

Ah i see, thanks for the help.