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
|
One of the irritating things about WPF is that you have to completely replace the control template in order to make changes to the appearance of the control beyond a certain very limited set of changes that you can accomplish with styles. So there seems to be a complete control template for the flow diagram connection in the CustomStyle.FlowDiagrams example. Therefore I can change the position of the connection content from the "from" connection to the "to" connection like this...
So first question: How would I position the connection content over the midpoint of the connection? Of course I can write a converter, but perhaps there is a simpler way to do it. Second question: I can't find the control templates for anything but the flow diagram connection. I would like to have the control templates for all of the flow diagram nodes. I am evaluating the diagram at the moment...so perhaps I get all these when I purchase? Regards, Bob Rundle |
|
|
Hello Bob At the moment we don't have a built in feature for specifying the position of the connection content. Writing a converter is currently the best way to do it. I have attached a sample to this post to demonstrate how to do this. To run the sample, you'll need to add a reference to your copy of the Mindscape.WpfDiagramming.Foundation.dll. Note you don't need the FlowDiagram dll for this one as it is a general sample that can work for any diagram type. In the ConnectionContentTransformConverter class, the input is the list of segments of the connection. The converter simply finds the center segment, and then finds the logical position of the center of that segment and returns the result as a TranslateTransform. This implementation is fairly simple, so you can modify it to your own needs if you want. In App.xaml is all the styles to make up a connection which you may be familiar with. Line 182 is where the converter is being used to position the connection content. And that's it. Let me know if you have questions about this. Templating a node is split into a couple of parts. The ControlTemplate provides all the core parts of the node such as the resizer thumb, rotate thumb, connection points, move thumb and node template host. This core template is used by all nodes for all types of diagrams. Next, node elements have a NodeTemplate property which is how different nodes can be made to look different. This is how you can provide shapes, colors and ui elements to define what each node actually looks like. Although it is possible to change the node ControlTemplate, It is not recommended as it is a bit complicated and is subject to change from improvements to the framework. If you can let me know roughly what you want to do in terms of editing the look of nodes, I can let you know the best approach you should take. For example, do you just want to change the shape/color/layout of the nodes, or do you want to change the look of the UI controls such as the connection points and resizer thumbs? I'll send you source code xaml of the parts you will need. For now, I've attached the flow diagrams GradientStyle which has the node templates that defines the look of all the flow diagram nodes. Jason Fauchelle |
|
|
Yes, thanks very much. The converter is very straightforward as I would have expected. Thanks also the flow diagram xaml. It is helpful to understand how the basic shapes are rendered. I am not really going anywhere in particular. I am simply evaluating the diagram package. I have evaluated a number of WPF packages from the various vendors at this point and I have learned to look closely at the implementation. WPF is a very elegant framework that paradoxically allows you to hide kluges very well. You think that the vendor's example promises a certain robust capability and then find out too late that it is a pencil balanced on its point. So I am simply looking at the diagram form the viewpoint of a guy who has been fooled once too often by WPF implementations. So far the diagram is holding up reasonably well. I am also evaluating your other controls and I am very disappointed that you don't have a WPF tree control. Regards, Bob Rundle |
|
|
Thanks for evaluating our controls. Are you referring to a WPF TreeView control? If so, what particular features are you interested in that the standard TreeView does not have? If you end up requiring one from us, you can put in a request in the Think Tank: http://www.mindscapehq.com/thinktank/product/15 Jason Fauchelle |
|
|
The Microsoft WPF TreeView control does not have multiple select, drag and drop support, and many other things. Other vendors have a TreeView control that has this support. You would have to work hard to make a better tree control than other vendors, however this is not really necessary. People like me would like to use WPF controls all from a single 3rd party vendor. At the moment I am using WPF controls from 3 vendors (4 if I choose to use your diagram control). This creates its own set of problems in regard to deployment and theming. So I am simply looking for "just good enough" controls in order to simplify control sourcing. I would really like to buy a comprehensive set of controls from a single vendor, but such a vendor does not exist at the moment. Regards, Bob Rundle |
|