C
C#3mo ago
FaNim

[WPF] DragDrop problems

private void ListBorder_MouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton != MouseButtonState.Pressed) return;
if (sender is not Border border) return;

DragDrop.DoDragDrop(border, new DataObject(typeof(IPlayer), border.DataContext), DragDropEffects.Move);
}
private void ListBorder_MouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton != MouseButtonState.Pressed) return;
if (sender is not Border border) return;

DragDrop.DoDragDrop(border, new DataObject(typeof(IPlayer), border.DataContext), DragDropEffects.Move);
}
so iam trying to do drag and drop and iam getting this error no matter if i use dispatcher and cant try catch because this exception not allowing me clicking anything in ui because its stuck on dragdrop: https://pastebin.com/mBk2aRUw
Pastebin
System.InvalidOperationException HResult=0x80131509 Message=Przet...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No description
3 Replies
MODiX
MODiX3mo ago
MODiX#0152
System.InvalidOperationException HResult=0x80131509 Message=Dispatcher processing has paused, but messages are still being processed. Source=WindowsBase
Quoted by
<@203166497198047232> from #bot-spam (click here)
React with ❌ to remove this embed.
Buddy
Buddy3mo ago
Afaik you should be using MouseEnter / MouseDown, not MouseMove MouseMove is called each time you move your mouse within the control
FaNim
FaNimOP3mo ago
Ohh thats good point
Want results from more Discord servers?
Add your server