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
|
I add some objects (shapes) into a toolbox (like the flowchart example, the "Step Notes" toolbox), but I want to dislay name in each object (shape), now it is ok for displaying tooltip, but how to display name for each object? |
|
|
Hello Sorry for the late reply. To do this, you will not be able to use the StepNodeTool extension as shown in the demos. Instead, you will need to set all the properties of the DiagramNodeTool manually to specify exactly what you want. There are 3 main things you need to set: In the direct content of the DiagramNodeTool - between the tags, you can define the visuals that appear in the tool box. In your case you'll probably want a grid containing a Path that defines the shape, along with a TextBox to sit somewhere over the top of the shape. You'll want to set the CursorVisual property to define the visuals as the toolbox item is being dragged to the DiagramSurface. This is generally exactly the same as what you specified as the toolbox visuals, but with the Opacity set to something like 0.6 to make it semi-transparent. This visual can be whatever you want though. For example, you may not want to display the text in the dragging visual - only the toolbox item. Last of all, you'll need to set the Builder property to specify what type of node this tool box item is going to build once it has been dragged onto the DiagramSurface. If you want to use our built-in nodes, you could use the FlowDiagramNodeBuilder and set the Shape property. Or, if you want the toolbox item to build one of your own nodes, you can set it to be one of your custom IDiagramNodeBuilder implementations. Then you can optionally set the ToolTip property, and possibly the Width and Height to set exactly the amount of space in the tool box you want the item to occupy. Examples of creating custom tool box items can be found in the ActivityDiagrams demo in ActivityDiagramToolBoxItems.xaml. These examples use custom node builders. Let me know if you have questions about any of this. -Jason Fauchelle |
|