Question and thoughts about dragging objects
-
Hello, I’m about to develop an application, I have almost everything sorted out but there is one thing I really can’t analyze and this is why I decided to ask it here, CodeProject is a huge source of knowledge (not always though :P), and I hope someone will enlighten me, so here it is. I will simplify the problem since it would take a considerable time to explain it fully. I need to display a surface (on the screen) where I will drag objects over it. Objects will be allowed on almost all of the surface and only some parts will block dragging. Since almost all of the surface is an ‘available zone’ I can’t imagine analyzing each pixel and see if I still can place my object there for each movement, that would be a performance killer (keep in mind that I will display approximately 100 objects or more, it could grow up to 500, I don’t think more than that). I will start from there, I don’t want to make early specifications so if anyone is interested in helping or just giving an opinion, I’d be glad. I will just say a couple things, I was planning to do this using Silverlight 4 and I saw a ‘Collision detection algorithm’ which may be useful. Thanks.
-
Hello, I’m about to develop an application, I have almost everything sorted out but there is one thing I really can’t analyze and this is why I decided to ask it here, CodeProject is a huge source of knowledge (not always though :P), and I hope someone will enlighten me, so here it is. I will simplify the problem since it would take a considerable time to explain it fully. I need to display a surface (on the screen) where I will drag objects over it. Objects will be allowed on almost all of the surface and only some parts will block dragging. Since almost all of the surface is an ‘available zone’ I can’t imagine analyzing each pixel and see if I still can place my object there for each movement, that would be a performance killer (keep in mind that I will display approximately 100 objects or more, it could grow up to 500, I don’t think more than that). I will start from there, I don’t want to make early specifications so if anyone is interested in helping or just giving an opinion, I’d be glad. I will just say a couple things, I was planning to do this using Silverlight 4 and I saw a ‘Collision detection algorithm’ which may be useful. Thanks.
Without knowing what the rest of your architecture is, I'd suggest that all you need do is position panels at the position that you want to disallow the drop and use those to determine the applicability of the operation.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Hello, I’m about to develop an application, I have almost everything sorted out but there is one thing I really can’t analyze and this is why I decided to ask it here, CodeProject is a huge source of knowledge (not always though :P), and I hope someone will enlighten me, so here it is. I will simplify the problem since it would take a considerable time to explain it fully. I need to display a surface (on the screen) where I will drag objects over it. Objects will be allowed on almost all of the surface and only some parts will block dragging. Since almost all of the surface is an ‘available zone’ I can’t imagine analyzing each pixel and see if I still can place my object there for each movement, that would be a performance killer (keep in mind that I will display approximately 100 objects or more, it could grow up to 500, I don’t think more than that). I will start from there, I don’t want to make early specifications so if anyone is interested in helping or just giving an opinion, I’d be glad. I will just say a couple things, I was planning to do this using Silverlight 4 and I saw a ‘Collision detection algorithm’ which may be useful. Thanks.
-
Without knowing what the rest of your architecture is, I'd suggest that all you need do is position panels at the position that you want to disallow the drop and use those to determine the applicability of the operation.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
Thanks, Since I don’t have much spare time outside work I didn’t had the chance to read about Silverlight, I don’t pretend to find the solution to my problem all worked out here, just ideas that might point me in the correct direction. But… could you explain me how panels could help me and how do you suggest I should use them? The areas might have strange forms (rounded, triangular, or anything actually), so it’s not just about placing a flat squared panel, I also have to take in consideration the height of the section where I’m dragging the object, not all the surface will have the same height, that’s where I think it might become tricky. I don’t know Silverlight panels, if I can give them any form using coordinates or something similar it could be though. Thanks again.
-
A set of drag drop API's are available in Silverlight 4 - these may be of some interest to you. You might also want to have a look at the drag drop manager.