Hi,
I have a question regarding margins, specifically the default syntax editor margins. I have a number of different context menus that I set based upon the file type that is active in the syntax editor, however, when the user mouse over any of the built in margins, line number for example I want to set the current context menu to null so that there is no context menu displayed but I am having a hard time trying to find where best do this, do you have any recommendations?
I should add that I have been using the following and it seems to work but I am not convinced this is the "proper" way.
[Modified at 10/20/2011 09:40 AM]
I have a question regarding margins, specifically the default syntax editor margins. I have a number of different context menus that I set based upon the file type that is active in the syntax editor, however, when the user mouse over any of the built in margins, line number for example I want to set the current context menu to null so that there is no context menu displayed but I am having a hard time trying to find where best do this, do you have any recommendations?
I should add that I have been using the following and it seems to work but I am not convinced this is the "proper" way.
editor.ActiveView.VisualElement.ContextMenuOpening += new System.Windows.Controls.ContextMenuEventHandler(this.VisualElement_ContextMenuOpening);
private void VisualElement_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
// Test the source, margins come in loud and clear
object source = e.Source;
}