Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dwndland/chapter.net.wpf.draganddrop

Chapter.Net.WPF.DragAndDrop brings objects and helper to work with drag and drop within the WPF application.
https://github.com/dwndland/chapter.net.wpf.draganddrop

csharp drag drag-and-drop drop wpf

Last synced: 20 days ago
JSON representation

Chapter.Net.WPF.DragAndDrop brings objects and helper to work with drag and drop within the WPF application.

Awesome Lists containing this project

README

        

logo

# Chapter.Net.WPF.DragAndDrop Library

## Overview
Chapter.Net.WPF.DragAndDrop brings objects and helper to work with drag and drop within the WPF application.

## 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

1. **Installation:**
- Install the Chapter.Net.WPF.DragAndDrop library via NuGet Package Manager:
```bash
dotnet add package Chapter.Net.WPF.DragAndDrop
```

2. **DropItem:**
- Usage
```xaml





```
```csharp
public void DemoViewModel : ObservableObject
{
public DemoViewModel()
{
DropFilesCommand = new DelegateCommand(DropFiles);
}

public IDelegateCommand DropFilesCommand { get; }

private void DropFiles(ItemsDroppedArgs e)
{
//e.Items[]
}
}
```

3. **DropItems:**
- Usage
```xaml








```
```csharp
public void DemoViewModel : ObservableObject
{
public DemoViewModel()
{
DropFileCommand = new DelegateCommand(DropFile);
DropFolderCommand = new DelegateCommand(DropFolder);
}

public IDelegateCommand DropFileCommand { get; }
public IDelegateCommand DropFolderCommand { get; }

private void DropFile(ItemDroppedArgs e)
{
//e.Item
}

private void DropFolder(ItemDroppedArgs e)
{
//e.Item
}
}
```

4. **DragItem:**
- Usage
```xaml





```
```xaml





```
```csharp
public void DemoViewModel : ObservableObject
{
public DemoViewModel()
{
DropItemCommand = new DelegateCommand(DropItem);
}

public IDelegateCommand DropItemCommand { get; }

private void DropItem(CustomDroppedArgs e)
{
//e.Item
}
}
```

## Links
* [NuGet](https://www.nuget.org/packages/Chapter.Net.WPF.DragAndDrop)
* [GitHub](https://github.com/dwndland/Chapter.Net.WPF.DragAndDrop)

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