开发者

PreviewMouseRightButtonUp does not fire when Context Menu is open

开发者 https://www.devze.com 2022-12-09 01:36 出处:网络
If I right-click on an Image I get the following events (shown in order): 1) MouseRightButtonDown 2) PreviewMouseRightButtonUp

If I right-click on an Image I get the following events (shown in order):

1) MouseRightButtonDown

2) PreviewMouseRightButtonUp

3) MouseRightButtonUp

At this point my Application displays a context menu. If that is open, and I right click on the image again I only get this event:

1) MouseRightButtonDown

Nor sure what to do to get these events whe开发者_StackOverflown a context menu is open?


How do you track events? What code do you have? Have you checked events with Snoop? It has really nice feature where you can track all routed events. It always helps you to find out who handles what:

PreviewMouseRightButtonUp does not fire when Context Menu is open


(source: blois.us)

And it shows that PreviewMouseUp is always coming, no matter ContextMenu is open or not...

PS: I know, I shouldn't write this before you answer previous questions, but have you tried:

img.AddHandler(PreviewMouseUpEvent, new MouseButtonEventHandler(ImgPreviewMouseUp), true /* Handled events too */);
void ImgPreviewMouseUp(object sender, MouseButtonEventArgs e)
{
 // 
}

:)

0

精彩评论

暂无评论...
验证码 换一张
取 消