We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to inherit Sf Diagram in Diagram Builder

Thread ID:

Created:

Updated:

Platform:

Replies:

116264 May 6,2014 11:04 AM UTC May 7,2014 04:39 PM UTC WinRT 2
loading
Tags: SfDiagram
Alaguraja Pandian
Asked On May 6, 2014 11:04 AM UTC

Hi,

      The sample code provided in documentation for adding nodes from code is as follows:

NodeViewModel node = new NodeViewModel()

{

// Unique Guid for NodeViewModel

ID=Guid.NewGuid()              

};

nodes.Add(node);

diagramcontrol.Nodes = nodes;

How do I add nodes through code in the diagram builder sample for below source code?

http://www.syncfusion.com/downloads/support/forum/116072/DiagramBuilder_modified_e8901a9c.zip



madhu
Replied On May 7, 2014 11:05 AM UTC

Hi,

      The sample code provided in documentation for adding nodes from code is as follows:

NodeViewModel node = new NodeViewModel()

{

// Unique Guid for NodeViewModel

ID=Guid.NewGuid()              

};

nodes.Add(node);

diagramcontrol.Nodes = nodes;

How do I add nodes through code in the diagram builder sample for below source code?

http://www.syncfusion.com/downloads/support/forum/116072/DiagramBuilder_modified_e8901a9c.zip



Adding points to the above post

In StencilView.xaml there is a data template called "SansStar".

How to programmatically add node "SansStar" using code in the Diagram Control as mention in the link (http://help.syncfusion.com/UG/winrt/Documents/nodes.htm)?

http://www.syncfusion.com/downloads/support/forum/116072/DiagramBuilder_modified_e8901a9c.zip


Parthiban A [Syncfusion]
Replied On May 7, 2014 04:39 PM UTC

Hi Madhu,

As you requested we have modified the sample. We can add nodes, groups and connections to DiagramVM.Nodes, DiagramVM.Groups and DiagramVM.Connectiosn respectively. We have added two nodes to DiagramVM.Nodes collections in DiagramVM constructor. And also we have added one resource dictionary named NodeTemplates, in which we have added node styles and templates, which in turn applied to nodes. For more information kindly refer the modified sample from attachment.

As Madhu requested we have added one node with SansStar data template applied, by adding those templates in NodeTemplates resource dictionary.

As Alaguraja requested, we have shown how to add nodes in code behind. Kindly refer the DiagramVM constructor from DiagramVM.cs file

Regards,

Parthiban


Attachment: DiagramBuilder_1162136a_85559d76.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;