Quantcast
Channel: Ribbon for WPF - Recent Posts
Viewing all articles
Browse latest Browse all 1458

PopupGallery categories dont appper when ItemsSource is binded to an observable collection

$
0
0

Hello!

I am confused with appearance of category headers in PopupGallery. When items collection is explicitly defined in XAML with ‘ribbon:PopupGallery.Category’ property on each item, the category headers are shown. When I bind CategorizedItemsSource to an observable collection which contains data objects (inherited from DependencyObject), the category header are missed, despite of that I set the attached Category property in object’s constructor, e.g.:

this.SetValue(PopupGallery.CategoryProperty,”GroupA”);

I also tried approach with binding the PopupGallery to a delegate property with:

ItemCategoryDelegate="{Binding MyItemCategoryDelegate,RelativeSource={RelativeSource Mode=FindAncestor, 
AncestorType={x:Type Window}}}"

Again, when CategorizedItemsSource is set to a XAML list, my static delegate method is called normally. When I change binding to the observable collection, the method is not called at all (it does not hit a breakpoint) and categories are ignored.

Can you provide an example how to make up categories with binding to an observable collection?

Thank you in advance!

Ilia


Viewing all articles
Browse latest Browse all 1458

Trending Articles