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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Stencil with Custom Nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

148823 Nov 5,2019 04:12 PM UTC Nov 7,2019 04:21 AM UTC WPF 3
loading
Tags: Diagram
Dave Dake
Asked On November 5, 2019 04:12 PM UTC

Hello,

I am trying to follow the demo on adding stencils and combining it with custom nodes. I am not having much success. 
I can either get the custom node to show up in the stencil, but cannot add it to the diagram, or have it show up on the diagram, but not show up in the stencil.

Is there an example, or demo that I can view that has a custom node in the stencil that works also on the diagram?

Thanks,

Karkuvel Rajan Shanmugavel [Syncfusion]
Replied On November 6, 2019 05:28 AM UTC

Hi Dave, 
 
Thanks for contacting Syncfusion support.  
 
Requirement : Need to use custom node in stencil and diagram. 
 
In SfDiagram we didn’t serialize Content, ContentTemplate, ShapeStyle while drag and drop from stencil. So we have to preserve the template and style in resources and assign them after adding node in diagram page. We have to create a custom property in custom node class and serialize it with the help of DataMember attribute and assign its value to content of the node.  
 
We have prepared a simple sample for your requirement. In the sample we have created a custom node class with custom property to retain the content of node and used a custom property to assign the content template in item added event. Please find the sample link below. 
 
 
Regards, 
Karkuvel Rajan S  


Dave Dake
Replied On November 6, 2019 03:55 PM UTC

The sample that you provided was very clear. I now understand how to use it.

Thank you.

Karkuvel Rajan Shanmugavel [Syncfusion]
Replied On November 7, 2019 04:21 AM UTC

Hi Dave, 
 
Thanks for the update. 
 
Please contact us if you need any further assistance. 
 
Regards, 
Karkuvel Rajan S  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon