WPF Drag & drop using Catel Toolkit

Sep 2, 2011 at 6:32 AM
Edited Sep 2, 2011 at 6:33 AM

I am trying to get drag & drop functionality in a WPF application using the Catel Toolkit. The requirements are fairly straight forward – dragging from a ListView onto an ItemsControl and also within the ItemsControl. The adorner is text, so nothing fancy. Are there any particular features of the Catel Toolkit I should use. And how would I pass the necessary parameters using one of these? Or just stick with the built in DoDragDrop handler and events?

Edit: Just wanted to clarify my question a bit further: In a number of other mvvm frameworks I have looked at there is an EventToCommand implementation, can & how does Catel Toolkit implement this (maybe I missed it in the documentation?). Additionally there is usually a “PassEventArgsToCommand” attribute that can be set to use the event args, does Catel Toolkit implement this?

 

Sep 2, 2011 at 9:43 AM

Catel also provides the EventToCommand behavior.

For your convenience, here is an example:

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="MouseDoubleClick">
            <catel:EventToCommand Command="{Binding Edit}" DisableAssociatedObjectOnCannotExecute="False" PassEventArgsToCommand="True" />
        </i:EventTrigger>
    </i:Interaction.Triggers>