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

Ribbon for WPF Forum

Posted 7 years ago by Ilia Korjoukov
Version: 12.2.0573
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

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

[Modified 7 years ago]

Comments (1)

Answer - Posted 7 years ago by Ilia Korjoukov
Avatar

Ok, it could a false alarm on my side.

In fact, I used a custom made wrapper over ObservableCollection what allows a cross-thread access. I guess, the problem is with this wrapper because, when I replaced it with a generic ObservableCollection, everything worked and category header appears.

Sorry for disturbance!

Ilia

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.