Two times context menu opening - How to avoid this?

Ribbon for WPF Forum

Posted 10 years ago by Anurodh Ora
Avatar
Hi,

We are creating the (Ribbon)context menu dynamically by handling right click event of our custom control. After all menus are created, for displaying we are setting ContextMenu.IsOpen property to true.

For each "right click" event first we clear the context menu items list and then creating new one but some how it first showing previous context menu list and just after that it shows current newly created menu item list. This looks like flickering.

We handled the context menu's "Closed" event where also we are clearing the menu items list but still we are getting flickering.

Please suggest how can we avoid this flicker effect?

Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Anurodh,

This probably is not anything specific to our controls, since our context menu inherits the standard WPF ContextMenu. Thus you most likely could reproduce it with a normal ContextMenu.

I would not recommend that you do this in mouse up though. WPF handles the request and display of context menus for you. As long as you have some sort of ContextMenu in a certain FrameworkElement, it will receive a ContextMenuOpening event in which you should be able to customize it before it displays.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.