Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Question and thoughts about dragging objects

Question and thoughts about dragging objects

Scheduled Pinned Locked Moved WPF
algorithmsperformancehelpquestiondiscussion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Zorro_
    wrote on last edited by
    #1

    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.

    P A 2 Replies Last reply
    0
    • _ _Zorro_

      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.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      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.

      My blog | My articles | MoXAML PowerToys | Onyx

      _ 1 Reply Last reply
      0
      • _ _Zorro_

        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.

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        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.

        _ 1 Reply Last reply
        0
        • P Pete OHanlon

          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.

          My blog | My articles | MoXAML PowerToys | Onyx

          _ Offline
          _ Offline
          _Zorro_
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A Abhinav S

            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.

            _ Offline
            _ Offline
            _Zorro_
            wrote on last edited by
            #5

            Thank you, I'll take a look at this tonight and see if it could work for me. Thanks again.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups