Class diagram(ClassShape) relation from code behind

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

    Posted 05 Nov 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
    Admin
    Martin avatar
    1099 posts

    Posted 09 Nov Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top