This is a migrated thread and some comments may be shown as answers.

Class diagram(ClassShape) relation from code behind

1 Answer 16 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 05 Nov 2016, 10:31 AM

how to create a Relation between two classes from code behind. created a relation for particular class but unable to define relation.

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 09 Nov 2016, 03:25 PM
Hello,

I don't know if I understand you correctly, but I think your are using the ClassDiagram demo example of RadDiagram. And you want to add a connection (releation) between two shapes (classes). If so, you can do that by creating a new instance of ClassLinkViewModel and set its Target and Source properties to the objects of type ClassViewModel representing the classes you want to relate. Then add the ClassLinkViewModel object in the ClassDiagramGraphSource.
graphSource.AddLink(new ClassLinkViewModel(classModel1, classModel2));

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Tags
Diagram
Asked by
Sunny
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or