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

Diagram collision detection

4 Answers 67 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Luka
Top achievements
Rank 1
Luka asked on 14 Jul 2014, 06:41 AM
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.)

4 Answers, 1 is accepted

Sort by
0
Luka
Top achievements
Rank 1
answered on 14 Jul 2014, 07:11 AM
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?
0
Luka
Top achievements
Rank 1
answered on 14 Jul 2014, 07:41 AM
The answer is trivial! Connections have .DragOver event! Great controls telerik!
0
Petar Mladenov
Telerik team
answered on 16 Jul 2014, 06:39 AM
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.
 
0
Luka
Top achievements
Rank 1
answered on 16 Jul 2014, 09:43 AM
Ofcourse, the code will be more managable if I create a CustomService for the diagrams, thanks for the tip! 
Tags
Diagram
Asked by
Luka
Top achievements
Rank 1
Answers by
Luka
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or