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,
Is this possible to have more than 4 connections connected to single node?
Regards, Peter |
|
|
Hello Peter Indeed it is possible to have as many connection points on a node as you like. This requires you to make your own custom node style which is very simple to do. A good place to start is to take a look at the FlowDiagrams.ConnectionPointRelocation and CustomNodeType samples in the samples solution. These have some custom nodes where you will see the connection points are added to them in their constructors. With creating your own node type, you'll also need to provide a template to define what they look like, and a node builder for building your custom nodes and adding them to the diagram. All this can be seen in the CustomNodeType sample. Try this out and let me know if you need more information Regards |
|
|
Thanks. |
|
|
Hello Jason, In the samples solutions there is no FlowDiagrams.ConnectionPointRelocation samples. In CustomNodeType samples i see the connection points are added to nodes in their constructors, but only one point at one edge.
Question: How can i add more then one connection points at one edge (side) ?
Regards, ShuraZ |
|
|
Second Question: Is this possible to have text inside node near every connection points?
Of course i can place text using custom DataTemplate of node. But how i can do it using custom Style (or DataTemplate) of connection point?
Regards, ShuraZ |
|
|
Hello It sounds like you might have an older copy of WPF Flow Diagrams. If this is so, you will want to download the latest nightly build (trial edition from the Downloads page, retail edition from the store). Then you should find the FlowDiagrams.ConnectionPointRelocation Sample. In this sample, there is a node that has 2 connection points on the bottom edge. Once you find the sample, here is what you need to do: - You will want to copy the IndexedConnectionPoint, IndexAwareTypeEdgeCalculator and IndexAwareFlowDiagramCalculatorSelector classes from the ConnectionPointRelocation sample and paste them into your project somewhere. Note that because these come from a sample, you may want to make modifications to them later depending on the needs of your project. Now for the most important part to get this working: In XAML, you need to create an IndexAwareFlowDiagramCalculatorSelector and set the BasedOn property to be a calculator selector from one of the provided themes if necessary. To this calculator selector, you can add IndexAwareTypeEdgeCalculators. On these you can specify the edge, node type, and index value to compare with an indexed connection point. You then also provide any kind of connection point calculator that you need to then position the connection point on its node. Finally, you just need to give this calculator selector to the formatter you made in the previous step. Also make sure you give the formatter to the DiagramSurface that will be rendering you diagram. By looking at the ConnectionPointRelocation sample, you should be able to understand all this better. I hope this points you in the right direction. Let me know if you need more clarification with anything or if you still can't find the sample. Regards |
|
|
Hello Yes this should be possible. To provide you own connection point template, you first need to make a node style. You can take a look at this blog post which tells you all about creating your own node style and giving it to the DiagramSurface. It contains a chunk of XAML which is the default node style which you can use to get started. Also, take a look at this forum thread. On the second to last entry, there is an attachment which is a sample showing how to provide a node style specifically for templating connection points. By looking at the XAML in the blog post, you will see an ItemsControl near the top. You can template connection points simply by setting the ItemTemplate property of this items control to be your custom template. Regards |
|
|
Thank you, Jason. |
|