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>
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