Jump to content
Software FX Community

Issue with customizing context menu after migration to chartfx 8


Recommended Posts

Hi,
 
After moving to ChartFx 8 from 7, we are having trouble with customizing context menu in the chart.
With CFX7, we were able to get the commands of the context menu (Chartfx) and add it to our custom ContextMenuStrip. Then handle the event (ex : Color selection, Point labels) by using the following code. With CFX8, the command CommandsEventArgs, ICommandCollection does not exist anymore. Also noticed that "Chart.UpdateContextMenu" is no longer supported. 

So my question is what are the replacement APIs for these in CFX8? If there is none, what is the best way to call these internal commands from our context menu.

 

 

Thanks

Rag

 
private void ContextMenu_PerformChartFXCommand(object sender, EventArgs e)
{
           ToolStripItem item = sender as ToolStripItem;
             CommandInfo commandInfo = (CommandInfo)item.Tag;
CommandsEventArgs eventArgs = new CommandsEventArgs(commandInfo.CommandId, commandInfo.SubCommandId);

eventArgs.uiObject = commandInfo.UiObject;

(this.Chart.Commands as ICommandCollection).OnCommandEvent(eventArgs);

if (item is ToolStripMenuItem)
{
(item as ToolStripMenuItem).Checked = this.Chart.Commands[commandInfo.CommandId].Checked;
}

 

Link to post
Share on other sites
  • 1 month later...

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...