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
|
Hi all
I have about 500 tools (simple C# classes) in a framework I am building an interface for.
I want to create a categorised toolbox. Instead of having to create 500 new classes inheriting from "FlowDiagramNode"'s, is there a way I can create 1 custom node, and attach my tool class to that node, along with a custom icon ? When they are dropped onto the DiagramSurface I'd like to be able to access them as you can now, via "Nodes" and the "Data" available on each one. Ideally, I would like to bind the toolbox to an Observable Collections of "some kind of node", with parameter to identify the tool.
Many Thanks Mark
|
|
|
Dont worry about this one now. I programmatically added a custom node and used the "Data" property to attach my custom class to. However, couple more queries...
Many thanks Mark |
|
|
Hello Mark 1. To make the port sizes bigger, you can make your own connection-point style. connection point styles can be applied via providing a custom node style. You can find out about making custom node styles from this blog post: http://www.mindscape.co.nz/blog/index.php/2009/09/29/wpf-diagrams-styling-a-node-element/. First, follow the steps in the blog post to make and apply the node style (that is large section of xaml). The first ItemsControl that you see in the xaml is where the connection points (ports) are included. You can set the ItemsControl.ItemTemplate property in order to provide your own template to make the ports bigger. Note that you only need to do this once. Once you've created the node style and given it to the diagram surface, it will affect all the nodes. 2. The user can select multiple items and press delete to remove them all. You simply need to set the DiagramSurface.SelectionMode property to either Multiple or Extended. Or if you need to delete them yourself, you can delete nodes directly from the Nodes collection of the FlowDiagramModel class. The FlowDiagramModel can be found using the DiagramSurface.Diagram property. 3. There are currently no alignment features yet. 4. Copy and paste is not yet implemented either. However we do have plans to implement it, but need to sort out what should be added to the clipboard. Regards |
|