Hi Domenico,
WPF control can be hosted into windows forms and vice
versa, though they have limitations too. Kindly refer the below msdn links to for
more about hosting feasibility.
http://msdn.microsoft.com/en-us/library/ms751761(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/ms742875(v=vs.110).aspx
We have analysed the provided sample, we found that you
have override the symbol palette items CloneContent function. It is used to set
the symbol palette items content at runtime, which can be any business object
or any other. You have tried to set node as symbol palette item content, exception
thrown due to some xml serialization limitations. Since xml serializer couldn’t
serialize generic collections. Here it tries to serialize observable collection
Ports in node.
We suggest that
no need to set node as symbol palette item content. By default if you drag and
drop any symbol palette item from palette, node will be added to diagram page
and symbol palette item content is set to nodes content. In your scenario path is
symbol palette items content, now when you drag drop to diagram page, created
node will have same path as its content. Hence there is no need to override the
content while runtime.
Kindly try the sample without overriding the
CloneContent function. If you need to do so, set node as symbol palette item’s content
while creating. Kindly find the modified sample below.
Please let us know, if you require further assist on
this.
Regards,
Parthiban A.
Hi Domenico,
This can be achieved by setting symbol palette item’s
content as custom node. When symbol palette item is drag and drop from palette,
by default we check the symbol palette item’s content internally. If it is
node, we automatically add that node to diagram control instead of creating new
node. We have modified you sample in which we had created custom node(AcGen)
and set it as symbol palette item’s content. And also this custom node content
is set as grid, which contains path in it. Hence when the symbol palette items
is drag and drop, custom node will be added to control and having path as it
content. For more information kindly refer the attached sample.
Regards,
Parthiban A.
Hi Domenico,
We could reproduce the reported issues. This is due to
duplication value for framework "Name" property. Since Symbol palette Item’s
content has same custom node, for each drag and drop operation. It will added
same node to the diagram control. Hence all the node has same name in it. We
have provided workaround in which, we renamed the name in loaded event. For
more information kindly refer the attached sample.
Regards,
Parthiban
A.