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.
Unfortunately, activation email could not send to your email. Please try again.

Ribbon MVVM (Gallery Binding)

Thread ID:

Created:

Updated:

Platform:

Replies:

118580 Mar 20,2015 06:51 AM Mar 23,2015 12:41 PM WPF 1
loading
Tags: Ribbon
Sergey
Asked On March 20, 2015 06:51 AM

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}">
            <ContentControl>
                <sf:Gallery VisualMode="Standard">
                </sf:Gallery>
            </ContentControl>
 </DataTemplate>

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}">
            <ContentControl>
                <sf:Gallery VisualMode="Standard"
                            ItemsSource="{Binding Items}">
                </sf:Gallery>
            </ContentControl>
        </DataTemplate>

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 12:41 PM

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

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,

Vijayalakshmi V.R.


CONFIRMATION

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.

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.

;