RibbonGallery, ContextMenu and ZoomedInItemTemplate

Ribbon for WPF Forum

Posted 6 months ago by Kevin Pagnat - ADN
Version: 21.1.3
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

Hi,

We are using ActiPro WPF Controls for a long time now.

I was working with the RibbonGallery and played with the ItemTemplate and ZoomedInItemTemplate. It works very well visually speaking. 

What doesn't work for me is that I need a contextual menu on each ItemTemplate. For that, without the "ZoomedInItemTemplate", I just added this code in the DataTemplate of my ItemTemplate.

ContextMenuOpening="OnContextMenuOpening" 
ContextMenu="{Binding Path= DataContext.ItemsContextMenu, RelativeSource={RelativeSource AncestorType=ribbon:RibbonGallery}}"

It was working well : the OnContextMenuOpening is just here to "set" the selected item because it seems right-click doesn't select the item.

Until I put the "ZoomedInItemTemplate" ... then nothing happens.

I have tried to move this piece of code to the ZoomedInItemTemplate, it seems to trigger the "OnContextMenuOpening" but the contextual menu is closed instantly and the "zoom template" is back in place.

What I don't understand is that the document is saying that "Clicks through the zoomed-in popup are transparent an will affect the item under it.", but that doesn't seem to be the case for "right-click".

Thanks for your help.

Kevin

Comments (1)

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kevin,

The zoomed-in content is displayed in a WPF Popup behind the scenes, with the popup having IsHitTestVisible="False".  That is what should be causing the transparent click kind of behavior through it.

In your case, are you (1) trying to create a unique context menu for each gallery item, and also (2) trying to ensure a right-clicked item is selected (normally only left clicks select items)?

It might be most helpful if you can put together a quick new simple sample project that shows what's happening and send that to our support address.  Please reference this thread in the email and be sure to exclude the bin/obj folders from the .zip you send so the email doesn't get spam blocked.  Then we can debug with that exact scenario and see what's going on.


Actipro Software Support

The latest build of this product (v24.1.2) was released 8 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.