?
Solved

How getting notified when an element beeng draged is droped ?

Posted on 2011-05-04
4
Medium Priority
?
313 Views
Last Modified: 2013-11-12
With Expression Blend 4 it's possible to drop a MouseDragBehaviour to an element from the asset. With this regard I have two Questions:
1) How can I catch the drop event of this element when it is released over a container  such as grid or canvas?
2) How can produce the same actions(Drag and drop) of the element by code (C#)
Iam Working with Silverlight 4!
thanks in advance!
0
Comment
Question by:bish wakim
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:saragani
ID: 35693557
Have the grid or canvas handle the Drop event.

for example:
canvas.Drop += ...
(or register the event on XAML).


For doing the same in code, you will to set AllowDrop=true on your Drag Scope, and when you start dragging, call DragDrop.DoDragDrop.

For having the effect that something is being dragged (You see a half transparent copy of what you are dragging), you need to create a VisualBrush of what you are dragging and draw it on an adorner.


See my reply and example here:
http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/WPF_and_Silverlight/Q_26980568.html

If you can't see the answer and don't wanna spend points then look at the the attachment I uploaded at that time which shows drag and drop in WPF:

http://www.megaupload.com/?d=UWN0C2ZB
0
 
LVL 11

Accepted Solution

by:
saragani earned 2000 total points
ID: 35705733
Does my solution help you?
0
 

Author Comment

by:bish wakim
ID: 35715519
Not yet! . Iam still trying. Soon I'lll  return back to you!!
0
 

Author Closing Comment

by:bish wakim
ID: 35799828
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question