© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
4 replies
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
image.png
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

WPF ContextMenu background color problems
C#CC# / help
2y ago
✅ Problems with wrapping in wpf Listbox
C#CC# / help
3y ago
✅ WPF
C#CC# / help
13mo ago
Wpf
C#CC# / help
3y ago