Hello,
We are using the Diagram component in our application to allow the user to edit networks (routers, links, etc.). We would like now to add the possibility to create nesting objects such as security zones, geographical areas, sites, etc.
Is there a recommanded way to create nesting objets, i.e. objets that can embed nodes? Moreover, we would also like to put nodes at the boundary of these nesting objects (e.g. zone gateaways).
Ideally, we would like to have a special kind of node that can be expanded to see the contained nodes or that can be opened in an other diagram.
Thanks for your help.
Nicolas.
Hi Nicolas,
We suggest you to try grouping functionality. It has ability to group collection of nodes
and connectors in to it. But it’s visual is purely based on containing nodes
and connector, i.e. (size and position). It does not have any specific
appearance. We have created a sample, in which we created group having two
nodes in it. When you re-size, re-position those node, group will be updated dynamically.
Regarding special kind of node, we suspect that this
also regarding group. As group contains nodes and connector, you can toggle
those visibility while collapse and make visible while expand it. For those
expand and collapse, you have to write your own logic as your desire.
Regarding “open in another diagram” query, we are
sorry couldn't understand you requirement clearly. Kindly provide more details with any
visual representation.
Please let us know if you require further assist on
this.
Regards,
Parthiban A.
Thanks for the reply, I will try this.
Hi Francisco,
We are sorry for the inconvenience caused. We have
confirmed issue with “ParentNode property is not working fine. The fix for this
is estimated to available on Volume 1, 2014 release. The tentative schedule of
volume release is end of March, 2014.We request you to group nodes using Nodes
observable collection property until then.
Regarding change visibility of group we have created a
sample to collapse the group. Kindly refer the below additional information.
To change the Visibility of Group, it should be binded
with ViewModel, so we have derived GroupViewModel with additional property.
Binding for Group is set in ‘GetGroupForItemOverride’
overridden method on CustomDiagram.
Code Snippet:
public class CustomDiagram : SfDiagram
{
protected override Group GetGroupForItemOverride(object item)
{
Group g=new Group();
Binding visi = new Binding();
visi.Source = (item as CustomGroup);
visi.Path = new PropertyPath("Visibility");
SetBinding(Syncfusion.UI.Xaml.Diagram.Group.VisibilityProperty, visi);
return g;
}
}
This sample is created based on MVVM design pattern,
however you can refer to following documentation to know other ways to add,
remove, customize diagram.
http://help.syncfusion.com/winrt
à
Diagram à
Appendix à
Rendering.
Regards,
Parthiban A.
Hi Francisco,
Diagram controls elements like Node, Connections and
Groups must be initialized before it used. We can either initialize collection
with DigramCollection or assign new observable collections to it.
Regards,
Parthiban A.
Hi Francisco,
We are currently analyzing on it, we will let you know
the status on Monday. (3 Feb, 2014).
Regards,
Parthiban A.
Hi Nicolas,
The reason behind that the entire nodes in diagram
control gets hidden, when visibility is collapsed in the provided sample is we incorrectly
set binding to diagram control, instead of group view. We have also updated
this in the sample.
As group and nodes are separate elements. If you collapsed
the visibility of group, it only hides the group not nodes in it. Hence we have
provided alternate approach in which we hide entire nodes in the group. Now
group will be hided.
Kindly find the updated sample from attachment.
Regards,
Parthiban A
Hi Francisco,
As we said already visual appearance of group is
purely based on containing nodes and connectors. For your requirement we have
created a demo sample to collapse and expand to show the nodes inside. When we
collapse the group, manually moves and re-size the nodes. Again while expanding we
restore its position and size. Now it will give you expand and collapse appearance.
We can set background for group by setting background
to its view (Group) via binding model and view. If you need to add any visual element
(Text) to group, you can edit the control template of group and add elements to
it. In the provided sample we had added text block at the center of the group. For
more information please refer the sample from attachment.
Regards,
Parthiban A.
Hi Francisco,
As we said already visual appearance of group is purely based on containing nodes and connectors. For your requirement we have created a demo sample to collapse and expand to show the nodes inside. When we collapse the group, manually moves and re-size the nodes. Again while expanding we restore its position and size. Now it will give you expand and collapse appearance.
We can set background for group by setting background to its view (Group) via binding model and view. If you need to add any visual element (Text) to group, you can edit the control template of group and add elements to it. In the provided sample we had added text block at the center of the group. For more information please refer the sample from attachment.
Regards,
Parthiban A.
NestedObjects_115429_e972c062.zip