Skip to content

Application crashes with nested drag source #227

@ShadowDancer

Description

@ShadowDancer

Hello,
I have TreeView in which all leaves may contain listview of items. Looks like dragdrop library is doing something wrong, as after selecting all items in listview and I doubleclick it I am getting InvalidOperationException("Property SelectedItem was registered as readonly and cannot be modified without authroization key"). How I can get around this error?

in System.Windows.DependencyObject.SetupPropertyChange(DependencyProperty dp) in System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) in GongSolutions.Wpf.DragDrop.Utilities.ItemsControlExtensions.SetSelectedItem(ItemsControl itemsControl, Object item) w D:\projects\git\gong-wpf-dragdrop\src\GongSolutions.WPF.DragDrop\Utilities\ItemsControlExtensions.cs:wiersz 292 in GongSolutions.Wpf.DragDrop.DragDrop.DragSource_PreviewMouseLeftButtonUp(Object sender, MouseButtonEventArgs e) w D:\projects\git\gong-wpf-dragdrop\src\GongSolutions.WPF.DragDrop\DragDrop.cs:wiersz 782 in System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) in System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) in System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

https://github.com/punker76/gong-wpf-dragdrop/blob/dev/src/GongSolutions.WPF.DragDrop/Utilities/ItemsControlExtensions.cs#L292

There is repro project:
https://github.com/ShadowDancer/DragDropBugDemo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions