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
|
I need to use nested diagram surface's . is there any sample project code for this. I changed the customnodetype sample to achieve this. but it throws nullreference exception when i dropped an element to nested diagram surface from toolbox. thanks. |
|
|
Hello Sorry for the late reply. WPF Diagramming does not directly support nested diagrams surface's and so there are no code examples. I have experimented with it before and another customer has achieved this as well so it still can be done. What you need to do is create a custom node style that includes a DiagramSurface within it. I have a feeling that you may have already done this, though I'm not sure whats causing the NullReference exception. If you could send me a code sample of what you have tried so far, then I will easily be able to assist you more. You can send code samples by attaching them to a forum post, or send it to jason@mindscape.co.nz. Make sure you remove the binaries first. Cheers |
|
|
I just send an email to you. it contains full sample project. |
|
|
Thanks, I have looked at the sample and found the issue. The reason for the NullPointer exception is because the DiagramSurface needs a diagram model. One way to resolve this is to include the following code within the DiagramSurface tag:
<ms:DiagramSurface.Diagram> Or alternatively, you may want to put a FlowDiagramModel property on the custom node type which the data template can bind with. By setting the DiagramSurface.Diagram property in one of these ways, the NullReference exception will be resolved. There are however some other problems. The main issue you may notice next is that if you move around one of the nodes in the nested diagram while the parent node is also selected, then both nodes will move around. This issue however will be solved in version 2.0. At least you now have a way to continue working with nested diagrams. Let me know if there are other issues to be solved. Cheers |
|
|
thanks for your reply, Actually if we move on like this ( i found an error and send you and then you fix and then tell me) i cant continue i think. because using nested diagrams causes lots of different unpredictable behaviours. dont you have a base sample for nested diagrams. for example as you said nullreference exception has gone, but new ones come out. i cant move nested diagram node, i cant draw sub diagrams in nested diagram , only node texts seen ( no nodes). i think lots of thinks will come out like this or my base sample is wrong starting point for nested diagrams. I have to make a demo application for drawing large business processes until this friday. it should support grouping nodes. i thought that i can use nested diagrams but it has lots of unpredictable behaviours. The thing i need actually is grouping in diagram surface, group ten nodes and give a name etc. nested diagrams is not necessary. how can i achive this. thanks a lot. |
|
|
Sorry, I am taking back my words :) all i need is to play with data template of nested diagram surface node.
|
|
|
Ah yes, sorry I forgot to say that to draw the nodes in the nested diagram, the Formatter property needs to be set as you have done here. Regards |
|