Diagram collision detection

5 posts, 0 answers
  1. Luka
    Luka avatar
    13 posts
    Member since:
    Oct 2013

    Posted 14 Jul 2014 Link to this post

    Hi! I'm testing your WPF controls and I'm trying to make a tree hiearchy with drag and drop. The thing is I want to disable dragging all over the place. First feature I'd need is to check for leaf to leaf collision. If I'm collinding with another leaf when dragging, i want to switch their places. The other feature i'm interested in is leaf to connection coliision. I want to do it so that if i drag a leaf and collide with a connection, if i drop it it connects to that connection, severs the connection to the old leaf and reconnects it on it's tail. What would be the best way to detect such collision in your wpf controls? Any ideas? (or maybe is there something like this already implemented? I read the docs but I might have missed something.)
  2. Luka
    Luka avatar
    13 posts
    Member since:
    Oct 2013

    Posted 14 Jul 2014 Link to this post

    Now that I asked this question I looked a little deeper and I saw that diagram objects are created from shapes that have .IntersectsWith .NET function. I'm gonna make some tests, but I wonder, will I be able to detect a connection object with this method?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Luka
    Luka avatar
    13 posts
    Member since:
    Oct 2013

    Posted 14 Jul 2014 Link to this post

    The answer is trivial! Connections have .DragOver event! Great controls telerik!
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 16 Jul 2014 Link to this post

    Hi Luka,

    We are glad to know about your success with customizing RadDiagram. You can also take a look at our CustomServices sample in GitHub from where you can get more ideas that might help in your scenario.

    Regards,
    Petar Mladenov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. Luka
    Luka avatar
    13 posts
    Member since:
    Oct 2013

    Posted 16 Jul 2014 Link to this post

    Ofcourse, the code will be more managable if I create a CustomService for the diagrams, thanks for the tip! 
Back to Top
UI for WPF is Visual Studio 2017 Ready