-
-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Showcase.WPF.DragDrop.NET45/Models/TextBoxCustomDropHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Linq; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using GongSolutions.Wpf.DragDrop; | ||
|
||
namespace Showcase.WPF.DragDrop.Models | ||
{ | ||
public class TextBoxCustomDropHandler : IDropTarget | ||
{ | ||
public void DragOver(IDropInfo dropInfo) | ||
{ | ||
dropInfo.Effects = DragDropEffects.Move; | ||
} | ||
|
||
public void Drop(IDropInfo dropInfo) | ||
{ | ||
var dataAsList = DefaultDropHandler.ExtractData(dropInfo.Data); | ||
((TextBox)dropInfo.VisualTarget).Text = string.Join(", ", dataAsList.OfType<object>().ToArray()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters