Skip to content

Wrong ObservableCollection EventArg after drag/drop #355

@tonecool

Description

@tonecool

I'm using ObservableCollection which is bound to ItemsControl ItemsSource property.

What I expect to get after drag and drop an item within control is NotifyCollectionChangedAction.Move event like this:

        private void MyCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Move)
            {
                //DO something
            }
        }

But instead I'm getting two events (NotifyCollectionChangedAction.Remove and NotifyCollectionChangedAction.Add). I'm not sure if this is by design but in my case it was complicating the logic to decide if there was new item added externally or just drag/dropped existing control item.

Repo

I can provide code example if needed.

Environment

  • GongSolutions.WPF.DragDrop 2.2.0
  • Windows 10
  • Visual Studio 2019
  • .NET Framework 4.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions