Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Drag and Drop Framework - Prism, dragging from one module and drop into another module
posted

Hi! I'm using prism in my application and I was wondering if there is anyway to use the drag and drop framework to drag items between to different modules.

Module 1                              Module 2

View A - ViewModel A   =>  View B - Viewmodel B

In View A I have a datatemplate that implements the following:

<ig:DragDropManager.DragSource >
<ig:DragSource IsDraggable="True"
DragChannels="ChannelA">
<i:Interaction.Triggers>
<i:EventTrigger
EventName="DragStart">
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<local:InvokeDelegateCommandAction
Command="{Binding Source={x:Reference DataTreeRootGrid}, Path=DataContext.OnDragStartCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
</i:EventTrigger>
<i:EventTrigger
EventName="DragEnter">
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<local:InvokeDelegateCommandAction
Command="{Binding Source={x:Reference DataTreeRootGrid}, Path=DataContext.OnDragEnterCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
</i:EventTrigger>
<i:EventTrigger
EventName="DragLeave">
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<local:InvokeDelegateCommandAction
Command="{Binding Source={x:Reference DataTreeRootGrid}, Path=DataContext.OnDragLeaveCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
</i:EventTrigger>
<i:EventTrigger
EventName="Drop">
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<local:InvokeDelegateCommandAction
Command="{Binding Source={x:Reference DataTreeRootGrid}, Path=DataContext.OnDropCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
</i:EventTrigger>
<i:EventTrigger
EventName="DragOver">
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<local:InvokeDelegateCommandAction
Command="{Binding Source={x:Reference DataTreeRootGrid}, Path=DataContext.OnDragOverCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
</i:EventTrigger>
</i:Interaction.Triggers>

</ig:DragSource>
</ig:DragDropManager.DragSource>

<ig:DragDropManager.DropTarget>
<ig:DropTarget IsDropTarget="True"
DropChannels="ChannelA"/>

</ig:DragDropManager.DropTarget>

I am able to drag and drop within this View A (which is intended). I am unclear how to enable the "Drop" event in Module B. (Via WPF I'd just set a control to "AllowDrop = true" and hook up to it's Drop event.) Is there someway to do this using your framework? 

Regards,

Nathan

Parents
No Data
Reply Children
No Data