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
|
Hello, I'm trying to use this component to create a diagram I had working with another component. I was using a Tree layout with LeftToRight direction and it looked like this with my old component: ...but the results with WPF Diagrams are not what I expected and it looks like this: How can I lay them out like that? Also as I create the nodes/connections dynamically, I can not specify the RECT when I create them, could that cause an issue? What I was expecting was if I add x number of nodes and the connections between them and choose a layout, the layout system would lay them out on the diagram surface based on its algorithm. Anything I am missing? |
|
|
Hello and thanks for trying our WPF Diagrams framework. What you were expecting is correct. Not specifying the RECT will not effect a tree layout. Please make sure you are using a TreeLayoutAlgorithm (not a HierarchicalLayoutAlgorithm), and make sure the LayoutDirection property has been set to LayoutDirection.LeftToRight. I've tried this at my end and it is working like in the first image you posted. If you are already doing this, or if it is still not working, it may be possible that you have an old version. Try installing the latest nightly build which can be downloaded from here: http://www.mindscapehq.com/products/wpfdiagrams/nightly-builds If this still does not work, send me a repro project or some code samples. Jason Fauchelle |
|
|
Hi Jason, Thanks for your answer. I have tried updating to the latest nightly build but I still have the issue. If you can have a look at the attached solution, I really appreciate if you could help me solving out the issues: -Layout issue I mentioned about. -For some reason the diagram nodes are kind of locked (as in cannot be moved) on the canvas, any idea why? Thanks a lot for your help. |
|
|
Hello Thanks for the project, this helped to find the problems. The layout issue is caused because the connection points have not been added to the nodes. In MainWindow.xaml.cs, go to the AddConnection method. To solve the problem you simply need to add the toPoint and fromPoint to the appropriate nodes. This would be done like this:
To solve the issue of the unmovable nodes, go to line 20 of MainWindow.xaml and set IsHitTestVisible to false on the Grid. This will allow the mouse events to pass through your custom node template and reach the control that moves the node. The reason why the MoveThumb is below the custom node template display is so that you can add interactive controls above the MoveThumb. Sorry for the confusion, we'll work on improving these for a future version. Jason Fauchelle |
|
|
Thanks Jason. Although setting IsHitTestVisible on the Grid didn't do the trick exactly, it pointed me toward the right solution. I needed to do that in the Border element of my node content template and that worked. Thanks for all your help. |
|