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.

Put UserControl fom Stencil to SfDiagram

Thread ID:

Created:

Updated:

Platform:

Replies:

123174 Feb 23,2016 09:56 AM Mar 11,2016 07:27 AM WPF 7
loading
Tags: SfDiagram
Dmytro
Asked On February 23, 2016 09:56 AM

Hello!
I tryng to add WPF UserControl element to SfDiagram from Stencil. 
For that, I placed to stancil object with ISymbol interface.

at Symbol param, i put uTest class, wich contains parameters for my UserControl object.
at SymbolTemplate contain UserControl object with binding to uTest class.
After that i can put object from stancil to diagram, but can`t copy it, or see it after save/load operation.

How can i do it correctly?
I attached my test programm, based in Flow Diagram example from Essential Studio.
Thank


Attachment: Stencil_7b19aa71.zip

Dmytro
Replied On February 24, 2016 04:06 AM

I understand, that for realisation of my idea i need to copy Content parameter from CustomNode parent to its clone. but i can`t understand at what time i need to do this?

Ranjitha Amirthalingam [Syncfusion]
Replied On February 24, 2016 08:38 AM

Hi Dmytro,

Thanks for contacting Syncfusion Support.

Requirement: To duplicate/Serialize the UserControl (Content of Node).

We have used DataContractSerializer for Serialization support and Duplicate operation is based on Serialization. So, The FrameWorkElements did not serialized as per DataContractSerializer Limitation. This causes the reported issue in your application. We have a support to achieve your requirement by using derived NodeViewModel and Property Changed. The Symbol and SymbolTemplate of Symbol will be assigned to Content and ContentTemplate when Dropping from Stencil.

Could you please confirm is your requirement to duplicate/Serialize the UserControl (Content of Node)?

FlowDiagram Sample:
In this Sample, We have updated the Diagramming objects while the respective Collection is Changed.  So, the Duplicate operation is working as expected.


Regards,
Ranjitha A.


Dmytro
Replied On February 24, 2016 09:06 AM

Thank you for answer. 
Yes this is exactly what i need,  duplicate/Serialize the UserControl (Content of Node).

Dmytro
Replied On March 2, 2016 04:41 AM

Hello! I solve this problem, but i still think that my way is not optimal:
After dropping element from stencil i save all diagram to stream whith its custom filds(Customnode.Content in my case), after that i load  it back. 
After this manipulations i can  duplicate/Serialize CustomNode whith Usercontrol in its Content field.
Anybody know more elegant way to solve my problem? 

Ramya Thirugnanam [Syncfusion]
Replied On March 3, 2016 06:30 AM

Hi Dmytro,
Sorry for the inconvenience caused.
With Regards to “Duplicate/Serialize the UserControl (Content and ContentTemplate of Node)”, we have created a simple sample with proper comments to achieve your requirement. Please refer to the sample from the following link.
Sample Link:123174

Sample Details:
In this Sample, We have used Custom NodeViewModel class to get the notification of Content and ContentTemplate property changes when drag and drop the symbol from Stencil. In that CustomNodeViewModel class, we have used custom properties to store and assign (after Serialization and Duplication) the value of Content and ContentTemplate of NodeViewModel.
Regards,
Ramya

Dmytro
Replied On March 10, 2016 04:31 AM

Thanks for your answer , it very helped me. but i still have some question: 
When i drop my custom object to Stancil, it's ok (thanks to your example). 
If i want to copy a few objects from CustomNode instrument, i need  to reshape them, in other way it gives back to me something with zero shape.

Ranjitha Amirthalingam [Syncfusion]
Replied On March 11, 2016 07:27 AM

Hi Dmytro,

We have considered this requirement “Notify when diagramming object is duplicated with source” as a feature request and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


                                      

Regards,
Ranjitha A.


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.

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.

;