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
|
Hey guys, is there an example available for this blog entry: http://www.mindscapehq.com/blog/index.php/2013/07/31/wpf-diagrams-improved-path-routing This would be very nice. Thanks Patrick |
|
|
Hi Patrick, Thanks for asking. To use custom pathfinders, you need to implement a custom connection (this is very simple) and override the Pathfinder property to get (and perhaps set) the pathfinder you want to use. You'll want to create a new AStarPathfinder and pass in the desired connection separation value into the constructor. Ideally, make sure all connection instances are using the same pathfinder instance - such as by making the pathfinder instance static. A sample of this is provided when you install WPF Diagrams. Run the Sample Explorer app, then in the left hand pane, click on "Algorithm explorer". Then on the right hand side, under the image and description, click "Open sample in Visual Studio" to see all the code. The custom connection implementation is in the Model folder, and the AStarPathfinder is instantiated on line 221 of MainWindows.xaml.cs Please let me know if you have further questions about this. -Jason Fauchelle |
|
|
Hi Jason, thanks for your replay. I love this router, really high performance. We are currently evaluating the WPF Diagram Framework and there is another question: Is the Diagramming Framework MVVM ready? Are there some examples available? -Patrick |
|
|
Hi Patrick, Great to hear you like the A* path router. We did design WPF Diagrams with MVVM in mind. The Diagram model can be built up in code, and then bound to the DiagramSurface control, as well as any other properties you need to set. There are a couple of areas that could be improved for MVVM however which would be selecting items, and setting the viewport which are currently done with methods rather than properties. We don't have a time frame of when we might improve these areas, but if you needed to, you could create attached properties which is the common fallback for keeping your application as MVVM as possible. All the samples that we have can be accessed through the Sample Explorer app that I mentioned previously. Let me know any further questions you may have. -Jason Fauchelle |
|