Drastic.DragAndDrop 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package Drastic.DragAndDrop --version 1.0.8                
NuGet\Install-Package Drastic.DragAndDrop -Version 1.0.8                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Drastic.DragAndDrop" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Drastic.DragAndDrop --version 1.0.8                
#r "nuget: Drastic.DragAndDrop, 1.0.8"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Drastic.DragAndDrop as a Cake Addin
#addin nuget:?package=Drastic.DragAndDrop&version=1.0.8

// Install Drastic.DragAndDrop as a Cake Tool
#tool nuget:?package=Drastic.DragAndDrop&version=1.0.8                

NuGet Version License

Drastic.DragAndDrop

Drastic.DragAndDrop is a simple API for adding Drag And Drop enabled views to existing controls. It is not intended to be the most "comprehensive" control, but to be an easy way to add basic functionality to an app. It can also serve as a springboard for your own controls.

example

How To Use

iOS/Catalyst

    internal class SampleViewController : UIViewController
    {
        private UILabel label = new UILabel() { Text = "Drag and Drop an image onto the window..." };
        private UIImageView image = new UIImageView() { BackgroundColor = UIColor.Gray };
        private DragAndDrop dragAnDrop;

        public SampleViewController()
        {
            this.SetupUI();
            this.SetupLayout();

            this.dragAnDrop = new DragAndDrop(this);
            this.dragAnDrop.Drop += this.DragAnDrop_Drop;
        }
    ...

WinUI

public sealed partial class MainWindow : Window
    {
        private DragAndDrop? dragAndDrop;

        public MainWindow()
        {
            this.InitializeComponent();
            this.dragAndDrop = new DragAndDrop(this);
            this.dragAndDrop.Drop += DragAndDrop_Drop;
        }

        private async void DragAndDrop_Drop(object? sender, DragAndDropOverlayTappedEventArgs e)

Tips

DragAndDrop can be applied to individual UIViews for UIKit, or UIElements for WinUI. When you apply the Drag And Drop view to a WinUI Window, it uses the internal contents of the frame as the drop zone. If your content does not extend to the edge of the Window (As it does in the default sample) then the drag and drop target will not extend to the edge of the window. If you wish to do that, nest your content within something like a Grid that extends to the edge of the frame.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-android33.0 is compatible.  net7.0-ios was computed.  net7.0-ios16.0 is compatible.  net7.0-maccatalyst was computed.  net7.0-maccatalyst15.4 is compatible.  net7.0-macos was computed.  net7.0-macos12.3 is compatible.  net7.0-tvos was computed.  net7.0-windows was computed.  net7.0-windows10.0.19041 is compatible.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.
  • net7.0-android33.0

    • No dependencies.
  • net7.0-ios16.0

    • No dependencies.
  • net7.0-maccatalyst15.4

    • No dependencies.
  • net7.0-macos12.3

    • No dependencies.
  • net7.0-windows10.0.19041

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Drastic.DragAndDrop:

Package Downloads
Drastic.DragAndDrop.Maui

A simple and straightforward Drag and Drop control for MAUI apps. Supports WinUI, Mac Catalyst, and iOS.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.9 400 12/31/2022
1.0.8 321 12/27/2022
1.0.7 332 12/26/2022
1.0.6 337 12/25/2022
1.0.5 323 12/24/2022
1.0.4 288 12/24/2022