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 there,
I'm very new to WPF Diagrams, and am still using the trial version to make sure it will do all we want (so far it looks great). I'm just wondering how (if possible) I go about customising the diagramshapes? I've not yet found an example so am not sure if I'm going about it the right way or not. I've got a working example of a DiagramSurface with a DiagramToolBox. I can drag the objects I've added onto the surface with no problems but the connectors don't seem to work correctly. (I'll have a look at the QuickStart example solution to see what i've done differently). I have some Basic Shapes such as Rectangle, Ellipse, RoundedRectangle, Parallelogram and Hexagon. How do I create my own? I'm using Blend 4.0 + Sketchflow and would like to be able to create them in that. for example, could I modify the <ms:DiagramNodeTool ms:ShapeTool.Shape="Rectangle"/> in some way? I've tried pulling the <ms:ShapeLayout x:Key="{Static ms:DiagramShapes.Rectangle}" Geometry="F0 M 0,0 L 1,0 1,1 0,1 Z" /> out of the baml file and put it into my xaml but it doesn't like the Static part of the key. Probably doing the wrong thing here. Either redefining the shapes or create my own would be good, either way.
thanks, Stephen Price |
|
|
Hello Stephen I've written a blog post explaining how to define your own shapes: http://www.mindscapehq.com/blog/index.php/2011/08/30/wpf-diagrams-custom-diagram-shapes/ You can dowload the full sample near the end to see all of the code. Defining your own shape only takes a small amout of code, so you can mostly just copy and paste parts of the sample and change the Geometry. You could ues Blend 4.0 to create the path geometries, though personally I'm not very good at using Blends path editing tool. Note that the values of the geometry should be between 0 and 1 so that they scale easily. Let us know if you have further questions about creating custom shapes. |
|