diff --git a/src/Showcase.WPF.DragDrop.NET45/Models/SampleData.cs b/src/Showcase.WPF.DragDrop.NET45/Models/SampleData.cs index 88df4227..d0cbef84 100644 --- a/src/Showcase.WPF.DragDrop.NET45/Models/SampleData.cs +++ b/src/Showcase.WPF.DragDrop.NET45/Models/SampleData.cs @@ -51,16 +51,12 @@ public SampleData() public GroupedDropHandler GroupedDropHandler { get; set; } = new GroupedDropHandler(); public ObservableCollection GroupedCollection { get; set; } = new ObservableCollection(); - public ObservableCollection DataGridCollection1 { get; set; } = - new ObservableCollection(); + public ObservableCollection DataGridCollection1 { get; set; } = new ObservableCollection(); + public ObservableCollection DataGridCollection2 { get; set; } = new ObservableCollection(); - public ObservableCollection DataGridCollection2 { get; set; } = - new ObservableCollection(); + public ObservableCollection TabItemCollection1 { get; set; } = new ObservableCollection(); + public ObservableCollection TabItemCollection2 { get; set; } = new ObservableCollection(); - public ObservableCollection TabItemCollection1 { get; set; } = - new ObservableCollection(); - - public ObservableCollection TabItemCollection2 { get; set; } = - new ObservableCollection(); + public TextBoxCustomDropHandler TextBoxCustomDropHandler { get; set; } = new TextBoxCustomDropHandler(); } } \ No newline at end of file diff --git a/src/Showcase.WPF.DragDrop.NET45/Models/TextBoxCustomDropHandler.cs b/src/Showcase.WPF.DragDrop.NET45/Models/TextBoxCustomDropHandler.cs new file mode 100644 index 00000000..f9f25bf0 --- /dev/null +++ b/src/Showcase.WPF.DragDrop.NET45/Models/TextBoxCustomDropHandler.cs @@ -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().ToArray()); + } + } +} \ No newline at end of file diff --git a/src/Showcase.WPF.DragDrop.NET45/Showcase.WPF.DragDrop.NET45.csproj b/src/Showcase.WPF.DragDrop.NET45/Showcase.WPF.DragDrop.NET45.csproj index 21845a62..35c949e9 100644 --- a/src/Showcase.WPF.DragDrop.NET45/Showcase.WPF.DragDrop.NET45.csproj +++ b/src/Showcase.WPF.DragDrop.NET45/Showcase.WPF.DragDrop.NET45.csproj @@ -70,6 +70,7 @@ + Code diff --git a/src/Showcase.WPF.DragDrop.NET45/Views/Issues.xaml b/src/Showcase.WPF.DragDrop.NET45/Views/Issues.xaml index b2b64766..ef7e2f30 100644 --- a/src/Showcase.WPF.DragDrop.NET45/Views/Issues.xaml +++ b/src/Showcase.WPF.DragDrop.NET45/Views/Issues.xaml @@ -278,8 +278,6 @@ - - @@ -344,8 +342,6 @@ - - @@ -399,8 +395,6 @@ - - @@ -481,6 +475,40 @@ + + + + +