-1

I am working in WPF Project where there is a combobox control where user want to drag and drop object. When user drag object on top of the control, it does not allow drop (Not allowed mouse cursor) I know by adding the drag over function, it may allow dropping but I am working in MVVM design pattern. Is there anyway to bind relay command to view model. i.e.

    <i:Interaction.Triggers>
    <i:EventTrigger EventName="DragOver">

1 Answers1

0

Make sure you have the correct xaml namespace added:

xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"

Then add the handler to your combobox like so:

<i:Interaction.Triggers>
    <i:EventTrigger EventName="DragOver">
        <cmd:EventToCommand Command="{Binding DragOverCommand}"
                            PassEventArgsToCommand="True" />
    </i:EventTrigger>
</i:Interaction.Triggers>
Hank
  • 1,976
  • 10
  • 15