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 have flow graphs that I'm rendering. Since each node can contain its own subgraph, I have the following setup for my root DiagramSurface:
These can nest as deeply as necessary. Here's what I'm seeing:
|
|
|
Hello Scott I have had a quick play around with this. I don't see any problems with the first issue you pointed out about the scroll bar visibilities, but the second one is indeed as you described. Regards |
|
|
I think what's happening with the scrollbars is that the nested DS is somehow interacting with the canvas of the parent DS. So the scrollbars are always showing up due to the larger size of the parent DS. On the nesting questions, here are my thoughts:
So ignoring printing and serialization (which I admit, might be a really big bucket), it seems like you're already really close to having this work. Also, I should mention that the models I'm using for propagating SelectedHierarchies and templating the nested DSs is already quite clean. I'm doing it with one extra DP, a single converter, and the rest is all data binding and templates in XAML. You might want to add it to the framework, but it's hardly necessary given how clean it already is. WRT what I'm trying to achieve, I'm basically building a dataflow graph for a business intelligence tool. Dataflow can be segmented into containers that run independently and have different semantics. I know one of your other customers asked on this forum about putting group containers around subdiagrams, which is at best a special case of this, so I don't think nesting is a super rare scenario. I'll clean up some of my in-flight code and put together a jing video for you to see what I mean on the nesting. I'll try to get that done by tonight (US eastern time). |
|
|
I worked on this for the few days. While it would be great to have comprehensive support for nesting, I've been able to work around all major issues with 2 exceptions: 1) The NullReferenceException on relocating connections that I reported separately. This is probably as simple as a null check to fix on your side. 2) When dragging nodes from the toolbox onto a nested Diagram Surface, the node is separately added to every containing graph along the way - all the way up to the root. That is, the one drop causes multiple adds. I am guessing that this can be fixed by setting e.Handled = true on a routed event, or something similar. Is there anyway we can get those two issues fixed in the short-term? Thanks, -Scott |
|
|
Hello Scott, Thanks for this info as it will help us to prioritise the work. We should be looking at these issues tomorrow with a view to getting them into the 22 July nightly build (which would be available on Tuesday morning US time). Is that a viable timeframe for you? We will also investigate proper nesting support, but as a more medium-term thing. |
|
|
Yes, that timeframe works for me. Thanks. Please let me know if you need any help reproducing the issues. I will probably continue posting some minor issues as I find them, but they will all be very low priority compared to the two noted above. In the medium term, consider me available to test anything you put together, as I have a fairly substantial code base built around this now. I can show you how I addressed some of the issues (like nested node/connection selection, expander sizing, container node management, animated autolayout/autoformat with viewport management, move handles on containers, etc.), if you are interested. I LOVE deleting code from my project, so I'd be happy to see much of that move into the control over time.
Thanks, -Scott |
|
|
Hello Scott For problem 1: I haven't been able to reproduce this, re-routing connections in a nested diagram seem to be fine. I have put in a null check in the most likely place to prevent the exception, but this may prevent re-routing in nested diagrams altogether. If you could give us more detail in how you are setting things up, or preferably send us a repro that has the exception being thrown then that will help us out (email it to jason@mindscape.co.nz - please remove the binaries). For problem 2: This has been solved and is available in the current nightly build. Cheers |
|
|
Unfortunately, I have things setup with one-way observer, and there is a lot of code behind the underlying model. I think it would be rather difficult to tease that all out. I have a source code license, so I've started debugging this. The issue is located in ConnectionRelocatorThumb.cs in InboundConnectionPointRelocatorThumb_DragDelta (line 320). When I start dragging, the first call to FindContainingSurface produces the expected result. The next time DragDelta is called, the call to FindContainingSurface returns null. It looks like the thumb thinks it's no longer part of the visual tree that includes the DiagramSurface. I'm going to continue down this path for a bit. Any pointers would be helpful. If you wanted to debug this together, I could send you a live meeting request for any time that works for you. |
|
|
Ok, I think it's due to the fact that my child DiagramSurface is being rendered inside an Expander. I believe the Expander content is rendered in its own VisualTree. This means that starting from the thumb and iterating through VisualTreeHelper.GetParent won't find a DiagramSurface once the floating thumb becomes associated with the Expander panel rather than the as a child of the DiagramSurface. This appears to happen when the Thumb "detaches" from its previous node. It seems this could be fixed in 2 ways: 1) Ensure that on drag, a thumb never "leaves" the visual tree of the DiagramSurface 2) Use a different method to find the DiagramSurface of the thumb that doesn't rely on VisualTree iteration. I'll continue down both of those paths. Let me know if you have a strong preference. |
|
|
Hello Scott I suspect that you may be getting this exception due to the way you have styled the node just as you have mentioned. However, When I put the DiagramSurface within an Expander within a node over here, I still don't see any problems with connection re-routing so there may be some other factor involved. If possible, you could e-mail me just the style your using for this node as well as any code behind so I can experiment with that. Also, I'm thinking of caching the DiagramSurface within the ConnectionRelocatorThumb which may solve the issue. Cheers |
|
|
Would it be possible for you to send me the working sample you have with the nested diagrams? I think it may be due to an interaction with another 3rd party control I have licensed. I's like to test with your sample to verify. scott.currie@varigence.com |
|
|
Hello Scott I have sent the requested sample. Let us know how it goes. Jason |
|