Hi,
Is there any way how to display context menu for the GalleryItem?
I have tried to use the following XAML but it does not work,
<ig:GalleryTool Caption="Views Gallery">
<ig:GalleryItem Text="Yesterday" Image="/Test.Dashboard.Infrastructure;component/Images/22/view_left_right.png">
<ig:ContextMenuService.Manager>
<ig:ContextMenuManager>
<ig:ContextMenuManager.ContextMenu>
<ig:XamContextMenu>
<ig:XamMenuItem Header="Rename" />
<ig:XamMenuItem Header="Delete"/>
</ig:XamContextMenu>
</ig:ContextMenuManager.ContextMenu>
</ig:ContextMenuManager>
</ig:ContextMenuService.Manager>
</ig:GalleryItem>
</ig:GalleryTool>
Thanks,
Alex
One way to achieve this is by using a Style:
<ig:GalleryTool> <ig:GalleryTool.Settings> <ig:GalleryItemSettings> <ig:GalleryItemSettings.GalleryItemStyle> <Style TargetType="ig:GalleryItemControl"> <Setter Property="ig:ContextMenuService.Manager"> <Setter.Value> <ig:ContextMenuManager OpenMode="RightClick"> <ig:ContextMenuManager.ContextMenu> <ig:XamContextMenu> <ig:XamMenuItem Header="Rename" /> <ig:XamMenuItem Header="Delete" /> </ig:XamContextMenu> </ig:ContextMenuManager.ContextMenu> </ig:ContextMenuManager> </Setter.Value> </Setter> </Style> </ig:GalleryItemSettings.GalleryItemStyle> </ig:GalleryItemSettings> </ig:GalleryTool.Settings> <ig:GalleryItem Text="Item 1" /> <ig:GalleryItem Text="Item 2" /> <ig:GalleryItem Text="Item 3"/> </ig:GalleryTool>
Hope this helps,
Hi Georgi,
cool, this approach works fine!
Thanks a lot
Regards,