punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
BSD 3-Clause "New" or "Revised" License
2.28k stars 400 forks source link

Add own cloneable interface for easier handling #436

Closed punker76 closed 2 years ago

punker76 commented 2 years ago

What changed?

Describe the changes you have made to improve this project.

Add own cloneable interface for easier handling:

/// <summary>
/// Supports cloning like the ICloneable interface, which creates a new instance of a class with the same value as an existing instance.
/// </summary>
public interface ICloneableDragItem
{
    /// <summary>
    /// Creates a new object that is a copy of the current instance.
    /// </summary>
    /// <param name="dropInfo">Object which contains several drop information.</param>
    /// <returns>A new object that is a copy of this instance.</returns>
    object CloneItem(IDropInfo dropInfo);
}

Add also a new interface for easier handling after item was dropped.

/// <summary>
/// Supports methods for models which can be dropped.
/// </summary>
public interface IDragItemSource
{
    /// <summary>
    /// Indicates that the item is dropped on the destination list.
    /// </summary>
    /// <param name="dropInfo">Object which contains several drop information.</param>
    void ItemDropped(IDropInfo dropInfo);
}

Closed issues.

Closes #435

punker76 commented 2 years ago

/cc @RickStrahl @Keboo