🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

OneCore.Net.WPF.DragAndDrop

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

OneCore.Net.WPF.DragAndDrop

OneCore.Net.WPF.DragAndDrop is a library that provides objects and helpers to simplify implementing drag-and-drop functionality in WPF applications.

Source
nugetNuGet
Version
1.0.1
Version published
Maintainers
1
Created
Source

OneCore

OneCore.Net.WPF.DragAndDrop Library

Overview

OneCore.Net.WPF.DragAndDrop is a library that provides objects and helpers to simplify implementing drag-and-drop functionality in WPF applications.

Features

  • DragItem: Allow drag selected item(s) or data context from any control.
  • DropItem: Allow drop of a particular type of files to a target controls.
  • DropItems: Allow drop of one or more particular types of items to a target control.

Getting Started

  • Installation:

    • Install the OneCore.Net.WPF.DragAndDrop library via NuGet Package Manager:
    dotnet add package OneCore.Net.WPF.DragAndDrop
    
  • DropItem:

    • Usage
    <ListBox AllowDrop="True">
        <onecore:Drop.DropItem>
            <onecore:DropItem Drops="Files" Effect="Copy" Command="{Binding DropFilesCommand}" />
        </onecore:Drop.DropItem>
    </ListBox>
    
    public void DemoViewModel : ObservableObject
    {
        public DemoViewModel()
        {
            DropFilesCommand = new DelegateCommand<ItemsDroppedArgs>(DropFiles);
        }
    
        public IDelegateCommand DropFilesCommand { get; }
    
        private void DropFiles(ItemsDroppedArgs e)
        {
            //e.Items[]
        }
    }
    
  • DropItems:

    • Usage
    <ListBox AllowDrop="True">
        <onecore:Drop.DropItems>
            <onecore:DropItemCollection>
                <onecore:DropItem Drops="File" Effect="Copy" Command="{Binding DropFileCommand}" />
                <onecore:DropItem Drops="Folder" Effect="Copy" Command="{Binding DropFolderCommand}" />
            </onecore:DropItemCollection>
        </onecore:Drop.DropItems>
    </ListBox>
    
    public void DemoViewModel : ObservableObject
    {
        public DemoViewModel()
        {
            DropFileCommand = new DelegateCommand<ItemDroppedArgs>(DropFile);
            DropFolderCommand = new DelegateCommand<ItemDroppedArgs>(DropFolder);
        }
    
        public IDelegateCommand DropFileCommand { get; }
        public IDelegateCommand DropFolderCommand { get; }
    
        private void DropFile(ItemDroppedArgs e)
        {
            //e.Item
        }
    
        private void DropFolder(ItemDroppedArgs e)
        {
            //e.Item
        }
    }
    
  • DragItem:

    • Usage
    <ListBox>
        <onecore:Drag.DragItem>
            <onecore:DropItem Drags="SelectedItem" Effect="Copy" Format="SelectedItem" />
        </onecore:Drag.DragItem>
    </ListBox>
    
    <ListBox AllowDrop="True">
        <onecore:Drop.DropItem>
            <onecore:DropItem Drops="Custom" Effect="Copy" Format="SelectedItem" Command="{Binding DropItemCommand}" />
        </onecore:Drop.DropItem>
    </ListBox>
    
    public void DemoViewModel : ObservableObject
    {
        public DemoViewModel()
        {
            DropItemCommand = new DelegateCommand<CustomDroppedArgs>(DropItem);
        }
    
        public IDelegateCommand DropItemCommand { get; }
    
        private void DropItem(CustomDroppedArgs e)
        {
            //e.Item
        }
    }
    
  • NuGet
  • GitHub

License

Copyright (c) David Wendland. All rights reserved. Licensed under the MIT License. See LICENSE file in the project root for full license information.

Keywords

FAQs

Package last updated on 05 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts