This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is there a way to always display connection points on a shape. At present connection points are only visible when the node is hovered over. Ideally, we need them to be visible all the time, and perhaps apply different styling to them when the node to which they are attached is hovered over. |
|
|
Hello This can be achieved by creating a custom node style and setting the Template property. This is where connection points are set up which allows you set their style. I have attached a sample with all the code demonstrating what you have described which you can copy. To run the sample, make sure to include a reference to your copy of the Mindscape.WpfDiagramming.Foundation.dll. When the sample is running, drag a node from the tool box onto the surface. You will see that the connection points are always visible even when the mouse is not hovered over them. When the mouse is over the node, the connection points change from red to green. All the code for achieving this is in the App.xaml file. Line 19 is a custom connection point style. This is a copy of the generic style. Notice that I have commented out all the style triggers. Even with the triggers commented out, the triggers from the generic style will still be in effect. So I have included another trigger on line 113 that simply makes the connection point visible if the mouse is not over the containing node. At line 128 is the node style. This is a copy of the generic node style and is used to set the custom connection point style. If you have other custom node styles, then they will need to be "BasedOn" this node style so that they all use the connection style. On line 243 is a custom connection point template. This defines the actual graphics of the connection point. Here I have included a trigger that listens to the IsMouseOver property of the containing node. If the mouse is over the node, then I change the color of one of the rectangles. This is applied to the diagram by using a FixedTemplateSelector and setting the ConnectionPointTemplateSelector property of the DiagramFormatter. Please let me know if you have any questions about any of this. |
|
|
Ah brilliant, this is just what i was looking for. Thanks for your help. |
|