Doing drag drop with HandPointers

As first seen on this thread:
http://social.msdn.microsoft.com/Forums/en-US/6b8d6251-c59a-46c7-9da8-b912cb16dfab/kinectregionaddhandpointerhandler?forum=kinectv2sdk
Take a look at http://1drv.ms/VQxR00
I've zipped up a DragDropElement implementation and a DragDropSample page.
You can place those 3 files in ControlsBasics-WPF in the Pages folder. Then add the following to the SampleDataSource -- put it near the KinectPointerPointSample reference in SampleDataSource.cs:
            group1.Items.Add(
                     new SampleDataItem(
                         "Group-1-Item-6",
                         "Drag Drop",
                         string.Empty,
                         SampleDataSource.lightGrayImage,
                         "Shows how to implement a DragDropElement",
                         itemContent,
                         group1,
                         typeof(DragDropSample)));
Would love feedback about this.
Thanks, Rob
Rob Relyea [MSFT] http://twitter.com/rrelyea
Rob Relyea [MSFT] http://twitter.com/rrelyea

This is a nice example of how to move a rectangle around a Canvas in Kinect...
But how can it interact with other objects? In my case ones that have AllowDrop="True"?
For example: If I put your DragDropElement around an Image then shift it up to a Canvas that is subscribed to the Drop event nothing is fired upon letting go.
The mouse equivalent of:
private void ImagePreview_MouseDown(object sender, MouseButtonEventArgs e)
DragDrop.DoDragDrop((DependencyObject)sender, ((Image)sender).Source, DragDropEffects.Copy);
private void Canvas_Drop(object sender, DragEventArgs e)
foreach (var format in e.Data.GetFormats())
ImageSource imageSource = e.Data.GetData(format) as ImageSource;
if (imageSource != null)
// Do something...
Thanks,
Brad

Similar Messages

  • RE: Drag & Drop with ListView

    By the way, has anyone tried to drag & drop a node from a listview to a
    treeview? I can drag a node from the listview. But when I drop it into
    the treeview, how can I find out which node of the treeview that I drop
    into? Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x233
    Fax 201.261.1399
    E-mail : [email protected]
    Ulrich:
    Try to change the state of the DVNodeText of the list view to FS_DRAG.
    For example,
    <MyListView.DVNodeText>.state = FS_DRAG. This may solve your problem.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x245
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Thursday, October 02, 1997 2:07 PM
    To: 'forte users'
    Subject: Drag & Drop with ListView
    Hi all,
    I am currently implementing a drag and drop between a listview and a
    treeview in Forte 3E.
    The TreeView has an IsDraggable attribute that allows me to drag treeview
    items while also highlighting the selected node. Unfortunately this isn't
    the case with the ListView control. If I put the ListView in a draggable
    state I can't see which node was selected.
    Can anyone supply a solution to draggiing from a ListView while also
    highlighting the node being dragged?
    Ulrich Lalk
    [email protected]

    Ulrich:
    Try to change the state of the DVNodeText of the list view to FS_DRAG.
    For example,
    <MyListView.DVNodeText>.state = FS_DRAG. This may solve your problem.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x245
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Thursday, October 02, 1997 2:07 PM
    To: 'forte users'
    Subject: Drag & Drop with ListView
    Hi all,
    I am currently implementing a drag and drop between a listview and a
    treeview in Forte 3E.
    The TreeView has an IsDraggable attribute that allows me to drag treeview
    items while also highlighting the selected node. Unfortunately this isn't
    the case with the ListView control. If I put the ListView in a draggable
    state I can't see which node was selected.
    Can anyone supply a solution to draggiing from a ListView while also
    highlighting the node being dragged?
    Ulrich Lalk
    [email protected]

  • Drag & drop with Safari

    I use a language site that needs the drag and drop gesture to match words with their meaning. When I try this on ipad's safari, it scrolls the page instead. Is there a way to turn off the scrolling so Safari responds to the drag and drop gesture?

    First, you aren't speaking to Apple here. This is strictly a user-user forum set up to provide technical support. If you want to make the request to Apple then do it via the iPad Feedback Form — http://www.apple.com/feedback/ipad.html
    First, though, you may stop and wonder about how Drag & Drop is already working in iOS in any number of apps, which, by the way, does include Safari. It may not work on some particular site that you're interested in, but certainly does in others.

  • Manual sync drag & drop with many playlists

    Ok I do not want to automatically sync my itunes with either my iPod or iPhone - end of story. I have 1000's of songs. I also organize my music by creating playlists, not just by artist but also DJ playlists. I have more single songs then entire albums. For years I've found the drag & drop highly irritating as it's the only way - that I know - to put a playlist manually on external devices. What I do instead is use a bullet or spaces before my playlist so they're at the top of the iTunes list but this is very tedious and and time consuming. I then have to remove the bullets/spaces once I've finished.
    Is there something I'm missing here? With every update of iTunes I'm hoping something as simple as "sync selected playlist to external device" in some form will show up. What's the story? Why is something so convenient and simple not available?

    Agreed!!! If I'm missing something here please let me know but to manually drag and drop play lists is not an option for me. I arrange all my music in play lists (as mentioned above). I need a way of safely backing up the lists in case they get lost / damaged / accidentally erased (I can't tell you how frustrating it is to hit the delete button by mistake - to lose a play list when all I wanted to do was delete a single track).......
    Currently my ipod is my only way off backing up the lists. I'm also constantly updating these lists, so to manually go and back up each play list would take weeks.....
    Backing up the data list (XML) wont do either. I need a way of backing the play list and actual tracks that are included in the list. I know a lot of people who share this concern.
    Apple, please help....

  • Drag & Drop with Fdev6iR2 on Linux / Adding object to an object group

    Hi all
    I experienced a very annoying bug in Forms Developer 6i Release II for Linux when I tried to add a Object to an Object group.
    The drag & drop simply doesn't work and there seems to be no way to work around this.
    Has anybody an idea whether there's another way to add an object to an objectgroup or what could cause this error?
    I'm using KDE 1.1.2-48 on XFree86 4.0.1-1 with Motif WM 1.2.4-3glibc installed, maybe this helps one of you...
    Thanks very much...
    Nik

    drag object using center mouse button.I think
    it will work.don't set caps lock on.
    --viji                                                                                                                                                                                   

  • Simple drag&drop with handler doesn't work in Edge?

    Hi all!
    I made this very simple example of Drag&Drop in Edge: http://www.terredainventare.it/simpledrag/simpledrag.html using Jquery Ui http://docs.jquery.com/UI/Draggable.
    I try to use the JQueryUi "handle" property that makes you drag an object restricting drag click on only one element but it doesn't work.
    Here's the code I've put in Edge onCompositionReady:
    sym.$("drag").draggable({ handle:"handler" });
    Of course my two Div-elements are called "drag" and "handler". Now the drag works only on the "wrong" element and not on the "handle".....
    Here's the Adobe Edge files: http://www.terredainventare.it/simpledrag/web.zip
    Many thanks in advance for your help!
    Davide

    So, on stage i add a rectangle named "drag" and i try this code:
    yepnope({
                nope:[
                'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js',
                'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css'
                complete: init
    function init() {
             //$("#Stage_drag").draggable();
             //$(sym.lookupSelector("drag")).draggable();
             sym.$("drag").draggable();
    3 lines work: $("#Stage_drag").draggable() or $(sym.lookupSelector("drag")).draggable() or sym.$("drag").draggable()
    And css file is not required.
    Well, your dowload link is not perfect but i download your folder. See you later.
    There is a tutorial: a movie tutorial (adobe tv). Mix it baby! Extending Edge Animate 02:57
    They use: yepnope (both, callback)
    yepnope({
         both: ['jquery-ui.min.js',
                   'jquery-ui.css'
         callback: function(){sym.$("drag").draggable()}
    I will send you your files tomorrow (private message).

  • Permanent list of duplicates using drag & drop with iPhoto 11

    Every time I drag and drop a photo into iPhoto 11 from a website or other source, I'm asked if I want to also add every other photo I've ever dragged and dropped in. I can opt not to import duplicates, but is there a way to clear out or avoid this ever-growing list?

    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.
    Look there for a Folder called 'Import' or 'Importing'.
    Drag it to the Desktop. *Make no other changes*.
    Start iPhoto. Does that help?
    If it does then look inside that folder on your desktop. Does it contain anything you want? If not you can trash the folder.

  • Qosmio x870 - Drag & drop with alt-tab not possible using touchpad

    Hello everyone,
    I have a problem with my Qosmio x870 and Synaptics touchpad drivers on Win7 64bit.
    They will not allow me to drag and drop between applications.
    As soon as I press Alt-Tab while dragging a file to switch to another application, dragging instantly stops.
    I'm using official & latest (15.3.41.7) Toshiba touchpad drivers from here http://goo.gl/pKHAI
    I tried installing generic Synaptics drivers and they don't have such a problem.
    With them, everything works fine with drag and drop,
    however, their implementation of two finger scrolling is really buggy and more than half the time it doesn't work so I can't use those.
    Does anyone know if this bug will be fixed and when?
    Any help? Thanks!

    Hi,
    I don't have "Advanced" tab in Mouse settings in control panel. Is there something i need to install in adition to Toshiba Synaptics drivers?
    I also tried changing every available setting in Synaptics drivers settings, but no change :(
    About Synaptics generic driver: Yes, I chose that one, but as I said, it's really buggy with two finger scroll, so I reverted back to Toshiba ones.

  • Reordering drag drop with manual application

    Here's some pseudo MXML of what I'm dealing with:
    <vbox id=1>
         <box/>
         <box/>
         <box/>
    </vbox>
    <vbox id=2>
         <box/>
    </vbox>
    I've applied manual drag event listeners to everyone and can easily drag and drop from one vbox to another. Where it goes awry is when I try to reorder the boxes. What happens is the vbox container picks up all the drag events (enter,over,etc) but none of the children do. I know a lot of the canned components like list and datagrid allow for reordering but for some reason this manual approach (which is necessary) isn't working.
    I've tried adding mouseEnabled=true on all the boxes to no avail. I've spent a day scouring forums and documentation to no avail.
    Any direction someone could point me in would be very beneficial.

    Kind of a bump, but worth adding - Ever since ActionScript 2 in Flash you've had something called a hitTest that allows you to basically do collision logic. So, if I drag one of my child <mx:Box> items around I can have a logic trap that says: 1. Which <mx:Vbox> parent container does this hitTest belong to? 2. Which child <mx:Box> does the freshly dropped <mx:Box> have a positive hitTest on. In that sense you can figure out what the user intended to do based on who he's dropping things on (or she of course).
    Whats missing from the built in FLEX Drag classes (at least that I've found so far) is the ability to do collision detection not only on the parent container but with the child elements inside  that container. Right now, it blocks ANY flavor of the drag and drop events to child objects. I'm not sure if that's bubbling, is it? Either way. I can do it the old way with hitTest collision checks but I'm sooooo close to being able to use the native DragEvents. Plus, that means I'll  have to write a class to handle data arrays being moved from one place to another which is just duplicating what's "almost perfect".
    Just point me in a direction guys, anything is better than the brick wall I'm stuck behind right  now.

  • Does drag & drop create a link or duplicate footage?

    Hi
    I have an external drive. trying to clear some space on one of the internal drives.
    when you drag and drop from say disk 2 (internal) to external drive, is that duplicating the footage or only creating a link?
    if its only a link, then where is the original footage?
    Im really having to relearn editing on FCP after using many pc based editing softwares.
    best, M/

    Also, if you're not familiar with the OS X Finder:
    When dragging a file from one disk to another:
    • Just dragging will COPY. (Notice the little + next to the cursor?)
    • Dragging with the Apple key held down will MOVE. (No little + next to the cursor.)
    When dragging within directories on the same disk:
    • Just dragging will MOVE. (No little +)
    • Dragging with the ALT key held down will COPY. (Little + will appear.)

  • Drag & Drop with ASOC

    I am still trying to learn the nuances of ASOC and just cannot seem to figure out drag and drop. For learning purposes, all I want to do is drop a file on an object and have a display dialog show the path to the file(s). Anyone have any experience with this? Thanks.

    The code is based solely on the MacScripter example and I am grateful to have found that much help. The object is an NSBox. The handler is in the subclass, but it seems as though the message is not being sent when dragging is initiated/completed. My code currently look like this:
    on draggingEntered_(sender)
    display dialog "Dragging Entered"
    set theFiles to sender's draggingPasteboard()
    set theOptions to {NSPasteboardURLReadingFileURLsOnlyKey:1}
    return theFiles's canReadObjectForClassesoptions({current application's |NSURL|}, theOptions)
    end draggingEntered_
    on performDragOperation_(sender)
    -- Get the file paths
    set theFiles to sender's draggingPasteboard()
    set theOptions to {NSPasteboardURLReadingFileURLsOnlyKey:1}
    set theURLs to theFiles's readObjectsForClassesoptions({current application's |NSURL|}, theOptions)
    display dialog theURLs
    -- return true
    end performDragOperation_

  • CS 5.0: inserting graphic via drag&drop with import options?

    Hi,
    is there a shortcut to show the import settings dialog window by dragging a graphic from outside of InDesign?
    Thanks.
    Carlos
    using win7/64, Adobe CS 5.0

    "Peter Spier" schrieb am 04.05.2012 um 14:26 Uhr:
    No tas far as I know, and dragging from outside, except from Finder, Bridge or Explorer is the equivalent of pasting, not importing.
    Okay, thank you!

  • Effect on Sprite breaks drag&drop mechanics

    Hello,
    I've a problem with applying effects to a number of SpriteVisualElements.
    I had set up a grid of said sprites and could drag and drop them around using the startDrag() and stopDrag() methods.
    I then decided to use effects to somehow animate these sprites when I click or drag them, and chose to play the effects in the handler of the MouseEvent.MOUSE_UP event.
    Things still work, but.... some effects break the drag&drop operation.
    The first time I drag or click the sprites everything works fine, but when I try to drag them again after the effect has been played once they won't drop. I can see the sprites move along with the mouse cursor as i drag them, but when I release the mouse button the sprites jump back to their starting position instead of dropping where I've just dragged them.
    This happens only on individual sprites once the effect has been played on them a first time. After that the effect still plays each time (meaning that the MOUSE_UP event is dispatched), but they won't drop.
    I'm also tracking the coordinates of the sprites as they are dragged, using a label I update through the MOUSE_MOVE event. The sprites' coordinates update normally the first time I drag&drop them, but then, after the effect is played for the first time, the coordinates won't update either.
    This only happens with effects that affect the sprites' appearance: s:Animate (scaleX, scaleY), s:Rotate, s:Scale.
    The only one that seems to work without causing any problem is s:Move. Don't understand why.
    Does anyone have any idea?
    Thanks a lot

    Oh, I see. Thanks.
    So... i should use the "normal" flex drag&drop.
    There is just a problem, the documentation says:
    The following Flex features are not supported in mobile applications:
    No support for drag-and-drop operations
    http://help.adobe.com/en_US/flex/mobileapps/WSf3db6597adcd110e19124fcb12ab3a1c319-8000.htm l#WSca1097f1363f276f-8bfd51512ba1a8112c-8000
    I had to work my way around this limitation one time in the past. I assumed that those lines referred to list-based controls only and I figured that maybe I could manually implement drag&drop with my custom components, which I did. It worked quite well, but unfortunately it also made the mouse cursor appear beneath my fingertip. It was very annoying and I couldn't find a way to get rid of it.
    I also thought about implementing the "flex" drag&drop using TouchEvents instead of MouseEvents (maybe that was the cause of the problem, I thought), but the DragManager.doDrag() method requires a MouseEvent as argument.... and that's when I decided to switch to the more basic .startTouchDrag() and stopTouchDrag() methods.
    Now, is there something else I could try?
    How do other people (more experienced than me) implement their drag&drop mechanics, for starters?
    Thank you :-)

  • Drag Drop List to List

    I have a source list and a destination list. I want to submit
    the contents of the destination list via my sendformdata function
    along with the other formitems.
    Here are my source/dest lists.
    <mx:VBox dropShadowEnabled="true">
    <mx:Label text="Available Loops"/>
    <mx:List id="srclist" width="300" height="150"
    allowMultipleSelection="true"
    dragEnabled="true" dropEnabled="true"
    dragMoveEnabled="true" labelField="category"
    dataTipFunction="myLabelFunc" showDataTips="true"
    alternatingItemColors="[#ece8ff, #ffffff]">
    </mx:List>
    </mx:VBox>
    <mx:VBox>
    <mx:Label text="Patched Loops"/>
    <mx:List alternatingItemColors="[#ece8ff, #ffffff]"
    id="destlist" width="200" height="150"
    allowMultipleSelection="true"
    dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
    labelField="category"/>
    </mx:VBox>
    user drags one or more items from the source to dest list.
    This works great.
    Now I need to pass the dropped/selected data in destlist to
    myobj, along with the other form items. How?
    <mx:Script>
    <![CDATA[
    private function sendFormdata():void {
    var myobj:Object = new Object();
    myobj.name = myname.text;
    myobj.email = myemail.text;
    myobj.entry = myentry.text;
    myobj.entrycomment = myentrycomment.htmlText;
    myobj.selectedcats= destlist.????
    cfdataInsert.addData({user:myobj})
    ]]>
    </mx:Script>
    Second part of my question is that I want the value of
    myobj.selectedloops to be a comma separated list of categoryid
    numbers (e.g. 1,3,5). My query, that populates the source list via
    the remoteobject contains categoryid,category, and description
    columns. I currently display the category in the labelField of the
    list, but I need to submit the categoryid to the DB.
    data comes from...
    <mx:RemoteObject
    id="cfdata" showBusyCursor="true"
    destination="ColdFusion"
    source="da8.Constellation.entries">
    <mx:method name="getCats" result="getCats_result(event)"
    />
    </mx:RemoteObject>
    getCats ColdFusion function...
    <cffunction name="getCats" access="remote"
    returntype="query">
    <cfset var CatData = "">
    <cfquery name="CatData" datasource="#DSN#">
    select categoryid,category,description
    from Categories
    order by category
    </cfquery>
    <cfreturn CatData />
    </cffunction>
    and then this function populates the srclist with the
    data....
    public function getCats_result(event:ResultEvent):void
    srclist.dataProvider = event.result as ArrayCollection;
    destlist.dataProvider =[];
    How do I pass the resulting destlist categoryids to
    myobj.selectedcats ?
    I don't know how the ArrayCollection organizes the query and
    how to reference the categoryid in the srclist and destlists.
    I'd appreciate any help.
    Thanks,
    Don

    SAP has lots of demo reports for drag and drop functionalities. Please check [Drag & Drop With the ALV Grid Control|http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5fbd2fe11d2b467006094192fe3/content.htm]

  • While dropping table, INDEXES created by us, note, not by oracle, does not drop.

    Hellow Friends,
    I want to know when we drop the table, the indexes created on it does not drop with it. Offcourse I know the indexes which are created when we give constraints on columns drops.
    Have you got my point, I am talking about those indexes which are created by us time to time according to our needs.
    Thankyou
    Sumeet

    Hellow Armold,
    I tried
    drop table <table_name>;
    ThankYou
    Sumeet

Maybe you are looking for

  • Animated .gif file doesn't animate in digital publishing

    Does anyone know why the animated gifs I made in Fireworks don't play when I preview my documents on the Adobe content viewer?

  • Shuffle shows up on laptop, but not desktop comp

    so my moms shuffle shows up on her laptop, but when plugged into the comp at home, it shows up on the computer until itunes pops up, it then asks if we want to do somethin with the library, we click no and then there is nothing.. i thought it was the

  • Vendor Invoice Number in FBl1n

    Hi MM Gurus, The client requires to have the Invoice Number which is generated at the time of LIV in FBL1n T. Code. I am getting the Accounting Document Number of Invoice but not the Vendor Invoice Number. I have tried everything from the Change Layo

  • Any Predefined Function in Oracle as 'ListAgg'

    Hi All, if we give input as '1,2,3,4,5' to get output as, 1 2 3 4 5 but there is a function for vice versa, listagg, just as like that I want to find out, if it is there any?Thanks,

  • Safari unexpected quit

    Hi everyone, I downloaded VLC player and a rar reader app called UnrarX tonight for watching a movie, but then, I started to get the "unexpected quit" crash from safari, I deleted the apps I lately installed, and tried to delete the webpageIcons.db f