Issues with DragAdornerBehavior
Posted: 07 Mar 2023, 17:04
I'm trying to have something follow the mouse while I am dragging, but there are two issues:
1): It seems that the drag only works while the cursor is under another control. If the cursor is not under another control, the control stops following the cursor.
2): The control that follows the cursor is far away from the cursor.
Video: https://files.catbox.moe/n240jv.mp4
This is in a UserControl that is the size of the entire screen.
1): It seems that the drag only works while the cursor is under another control. If the cursor is not under another control, the control stops following the cursor.
2): The control that follows the cursor is far away from the cursor.
Video: https://files.catbox.moe/n240jv.mp4
This is in a UserControl that is the size of the entire screen.
Code: Select all
<Grid>
<b:Interaction.Behaviors>
<noesis:DragAdornerBehavior x:Name="DragAdorner" />
</b:Interaction.Behaviors>
...
<Border Width="25" Height="25">
<Border.RenderTransform>
<TranslateTransform X="{Binding DraggedItemX, ElementName=DragAdorner}" Y="{Binding DraggedItemY, ElementName=DragAdorner}" />
</Border.RenderTransform>
<Image Source="{Binding DraggedCharacter.Icon}" />
</Border>
</Grid>