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
|
ur Hi all, i builded a graph editor using other component (graph#), now i'm evaluating to replace it with your the actual component layout the graph with some predefined alghoritm and there's no way to store the changes the user made on the layout. the user can move a node but i cant get the new position when i save the diagram and store the changes... So the most important requirment is to get and set for each node the location (x,y). can i create a connection propgrammatly and bind the edge to viewmodel? can i add a context menu to each node? can i style the node using datatemplate? can i have a readonly node with no editing, with no rotation, with no connection feature? only i need to handle click on node and contextmenu add a pic to see the actual. thanks! |
|
|
Hello Thanks for evaluating our diagrams product. Our diagram framework comes with an underlying model that you can manipulate and read. This includes the positions/size of nodes and the connectivity of the connections to the nodes etc. The model objects we provide can be extended to suite extra requirements of your application. Or nodes and connections in our built-in model can be mapped to node/connections in your own business model if you already have one. To get started, if you haven't done this already, start by following this getting started tutorial: http://www.mindscapehq.com/blog/index.php/2011/05/16/getting-started-with-wpf-diagrams-2-0/ Next try adding some nodes and connections programatically. Here is a simple example:
ds.Diagram gives you access to the default Diagram model class. You can also replace this with a new instance of one of our different diagram model types, or your own diagram implementation/extension. The diagram model has a collection of nodes and a collection of connections. You can access these properties as seen in the example above. This allows you to add/remove nodes and connections, or read the various values of these objects such as their positions. To connect the connections, a connection must have a source and a destination connection point. Connection points are situated on nodes or on other connections. In the example above, you can see I'm passing a connection point from node1 and node2 into the constructor of the connection. Here is a blog post about the basics of templateing/styling a node: http://www.mindscapehq.com/blog/index.php/2011/05/31/wpf-diagrams-2-0-custom-node-styles/ You can add a context menu using a custom node template/style. You can make the diagram readonly by setting the DiagramSurface.IsReadOnly property to true. The context menu on the node template will still work. This should get you started with what you want to achieve. Let me know if you have any questions about this. Jason Fauchelle |
|
|
hi, thanks for reply, is there some demo i can download to check all features? thanks. |
|
|
Hello You can download the free trial from the product page here: http://www.mindscapehq.com/products/wpfdiagrams This will install an application called "Sample Explorer". You can run this by going to the Windows Start menu -> Mindscape -> WPF Diagrams -> Sample Explorer. On the left hand side of the application is a list of samples. The top category ("Diagram types") shows the 3 built-in diagram model implementations we provide. The next category ("Diagram concepts") shows you how to use some of the main features such as custom node/connection implementation and templating. When you click on one of the sample from the list, you will see the "Launch Sample" button and "Open sample in Visual Studio" link under the sample image. Let me know if you have any questions about any of the features. Jason Fauchelle |
|