Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/dwndland/chapter.net.wpf.draganddrop
- Owner: dwndland
- License: mit
- Created: 2024-12-01T18:47:25.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-12-01T18:48:00.000Z (2 months ago)
- Last Synced: 2025-01-01T21:16:02.470Z (about 1 month ago)
- Topics: csharp, drag, drag-and-drop, drop, wpf
- Language: C#
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.