EventToCommand sample (drag&drop in SL4)

52 views
Skip to first unread message

Laurent Bugnion, GalaSoft

unread,
Dec 17, 2009, 2:54:07 PM12/17/09
to wpf-di...@googlegroups.com

Hey guys,

 

Silverlight 4 has the ability to handle drag&drop. As most things in Silverlight and WPF, this happens through an event (DragEventArgs), which of course leads to code behind. To avoid this, you can use the EventToCommand trigger (a kind of Blend behaviors) that is part of the MVVM Light Toolkit. This component is available for WPF and SL (3 and 4) and allows to bind in XAML any event to an ICommand.

 

I explained here how to handle the drag/drop event directly in the VM, without code behind, but of course this component can be used for other events as well.

 

http://blog.galasoft.ch/archive/2009/12/17/silverlight-4-dragampdrop-with-eventtocommand.aspx

 

As usual, feedback is welcomed.

 

Cheers,

Laurent

--

Laurent Bugnion [Microsoft MVP, MCP]

Blog: http://blog.galasoft.ch

Web: http://www.galasoft.ch

Support children in Calcutta: http://www.calcutta-espoir.ch

 

cid:image001.png@01C9C8AA.B722DA80

My

business

card

as

Microsoft Tag

 

 

image001.png

Karl Shifflett

unread,
Dec 18, 2009, 8:30:07 AM12/18/09
to wpf-di...@googlegroups.com

Thanks Laurent!

image001.png
Reply all
Reply to author
Forward
0 new messages