none
Menus and Drag and Drop RRS feed

  • Question

  •    I was trying to figure out a way to make a menu that was customizable by clicking on menu items and dragging them to new locations (either in the same menu or a different one).  Would this be possible with the Drag and Drop functionality in WPF of is there some other way?  I tried deriving a class MyMenu from Menu, setting its AllowDrop = true and then having derived MenuItems that implement the logic to allow them to be dragged.  The problem is when the drag of the menu item begins the menu it is on disappears, not really the desired behavior.  Am I doing something wrong or is this not possible using Drag and Drop?

    Renacer

    Wednesday, February 22, 2006 5:51 AM

Answers

  •     I guess when you drag a specific MenuItem, you  will most likely remove that MenuItem from the original parent control, so you have to add it to some other parent control's Children or Items collection, so the MenuItem can be visible before you drog it.

         If you can post the code here, we probably can better understand how do you write the drag and drop code behind the scenes.

     

    Sheva

    Wednesday, February 22, 2006 12:09 PM

All replies

  • Maybe some code to see if you are missing something?
    Wednesday, February 22, 2006 10:42 AM
  •     I guess when you drag a specific MenuItem, you  will most likely remove that MenuItem from the original parent control, so you have to add it to some other parent control's Children or Items collection, so the MenuItem can be visible before you drog it.

         If you can post the code here, we probably can better understand how do you write the drag and drop code behind the scenes.

     

    Sheva

    Wednesday, February 22, 2006 12:09 PM