Here is my problem; I want to display a context menu, with items created on the fly in the code behind, when a D&D operation has finished.
What I can’t do is
- Insert an item that will cancel cancel the drop operation, if selected
- I can’t find a way to keep the menu open when I click anywhere outside of the menu
How can I do these two things?
Displaying the context menu will not block the D&D operation from completing, so it won’t wait until the user addresses the context menu. You would have to somehow save the D&D action (capture what is being dropped and hold on to it) and wait to complete the action until after the context menu has been addressed.
A context menu will automatically close when it loses focus. However there is a StaysOpen property that overrides this behavior. If you set
StaysOpentotrue, it will remain open until you explicitly close it (by settingsIsOpentofalse).