c# - Event before the Context Menu is opened -


In this simple sample I want to show before a MessageBox context menu.

I write this code on an 'XAMA':

   & Lt; MenuItem Header = "Paste Paste" name = "MayPist" Click = "May Pastekillic" /> & Lt; / ContextMenu & gt; & Lt; /Border.ContextMenu> & Lt; Image Stretch = "Fill" Source = "{Binding Path = Product. Picture}" /> & Lt; / Border & gt;   

And I write it in 'CACS':

  Private Zero context menu property menu open (Object Sender, ContextMenuEventArgs e) {MessageBox.Show ("OPPENING "); }   

I do not know why, when I press the right mouse button, the context menu appears but the message box is never shown.

I believe the context menu openings should be defined for control, on which reference The menu has been opened, not just the context menu. If the code below will work for you, see:

  & lt; Open the Border Contacts menu = "context menuUntive menuupping" & gt; & Lt; Border.ContextMenu & gt; & Lt; ContextMenu & gt; & Lt; MenuItem header = "select picture" /> & Lt; MenuItem Header = "Paste Paste" Name = "MayPast" /> & Lt; / ContextMenu & gt; & Lt; /Border.ContextMenu> & Lt; / Border & gt;   

Hope this helps,

Comments