We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ribbon MVVM (Gallery Binding)

Thread ID:





118580 Mar 20,2015 10:51 AM UTC Mar 23,2015 04:41 PM UTC WPF 1
Tags: Ribbon
Asked On March 20, 2015 10:51 AM UTC

Hello dear developers,
I have one question.

I have tried to bind to Gallery with MVMM but I couldn't do it.

At first I created DataTemplate for Syncfusion Gallery.
Here is it.

<DataTemplate DataType="{x:Type vm:GalleryViewModel}">
                <sf:Gallery VisualMode="Standard">

After that I compiled my application and got empty RibbonGroup.
Ok. it is normal bacause I did not set ItemSource for Gallery.

I set ItemSourse to Gallery DataTemplate and got this:

<DataTemplate DataType="{x:Type vm:GalleryViewModel}">
                <sf:Gallery VisualMode="Standard"
                            ItemsSource="{Binding Items}">

After build and run application I got a strange exception.

An unhandled exception of type 'System.InvalidCastException' occurred in Syncfusion.Tools.WPF.dll

Additional information: Unable to cast object of type 'TestGalleryBinding.ViewModels.GalleryCategoryViewModel' to type 'Syncfusion.Windows.Tools.Controls.GalleryGroup'.

Could you explain me how I should make DataTemplate for Gallery, GalleryGroup and GalleryItem?

I attached sample that describes this problem.

Yours faithfully,
Sergey Vlasov

Attachment: TestGalleryBinding_2fc288ff.zip

Vijayalakshmi Roopkumar [Syncfusion]
Replied On March 23, 2015 04:41 PM UTC

Hi Sergey,

Sorry for the inconvenience caused,

We were able to reproduce the reported exception with the Gallery and we have logged a defect report regarding on this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Please let me know if you have any questions.


Vijayalakshmi V.R.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon