Class diagram(ClassShape) relation from code behind

2 posts, 0 answers
  1. Sunny
    Sunny avatar
    3 posts
    Member since:
    Nov 2016

    Posted 05 Nov 2016 Link to this post

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


  2. Martin Ivanov
    Martin Ivanov avatar
    1442 posts

    Posted 09 Nov 2016 Link to this post


    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));

    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top