Handling mouse cilck left button event

Mouse left button event is not being fired.

workflowDiagram.PartManager = new WorkflowPartManager();
workflowDiagram.LinkingTool = new WorkflowLinkingTool();
workflowDiagram.RelinkingTool = new WorkflowRelinkingTool();

workflowDiagram.DragSelectingTool = new WorkflowDragSelectingTool();


(workflowDiagram.CurrentTool as ToolManager).MouseLeftButtonDown += new MouseButtonEventHandler(DesignSurface_MouseLeftButtonDown);


void DesignSurface_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

{
MessageBox.Show(“Test”);

}


Any ideas?

Tools do not receive or raise any events. But you can override their methods.

However, what is it you really want to do?

I want to handle mouse click event on design surface.

If you just want to handle a click inside a node, just add that event handling to your node DataTemplate’s elements. (The same is true for links.)

If you just want to handle a click in the background of the diagram, not on a node or a link, then you can implement event handling on the Diagram itself, or on its Diagram.Panel. This would be in addition to the standard behavior that the GoXam offers for diagrams.

If you want to modify or replace the standard behavior that happens for clicks, then you need to add or modify or remove the relevant tools that are registered for the diagram.

For example, it is commonplace to set the Diagram.ClickCreatingTool to have a Node created at a click or double-click point by making a copy of some node data and adding it to the diagram’s model. There are examples of this in the StateChart, DynamicPorts, and UpdateDemo samples.

So it depends on what you really want to do.

Eventhandling of Mouseleftbuttondown on Diagram is not working.

Are you using Silverlight? GoXam implements a DiagramPanel.MouseLeftButtonDown event handler, which calls Diagram.CurrentTool.DoMouseDown().

I want at the same time, to handle a right <span =“highlight” style=": rgb248, 248, 252; text-align: left; “>click( MouseRightButtonDown ) inside a <span =“highlight” style=”: rgb248, 248, 252; text-align: left; “>node that will show a popup, (I added that event handling to <span =“highlight” style=”: rgb248, 248, 252; text-align: left; ">node DataTemplate’s elements and node panel), and handle a MouseRightButtonDown event in the background of a DiagramPanel that will show an other popup.

The problem is that after a rightClick, the Diagram popup is the only one that appears whether I click on the background or on a node, unless I delete the Diagram Panel.I don’t understand why!!?

I’m not sure what you’ve done. It might be easiest to follow the conventions used in the “Basic” sample app that is new in the version 1.3 beta kit. It defines context menus for nodes, for links, and for the diagram as a whole, i.e. in the background.