48 |
49 | ## Features
50 |
51 | + Works with MVVM : the logic for the drag and drop can be placed in a ViewModel. No code needs to be placed in code-behind, instead attached properties are used to bind to a drag handler/drop handler in a ViewModel.
52 | + Works with multiple selections.
53 | + Can drag data within the same control to re-order, or between (different) controls.
54 | + Works with `ListBox`, `ListView`, `TreeView`, `DataGrid` and any other `ItemsControl`.
55 | + Can insert, move or copy an item into a collection of the same/another control (same item type).
56 | + Can display Adorners to give the user visual feedback of the operation in progress.
57 | + Can display a preview of the dragged item (the preview is always visible).
58 | + Has sensible defaults so that you have to write less code for common operations.
59 |
60 | ## Let's get started
61 |
62 | - [Building](../../wiki/Building) the `gong-wpf-dragdrop` solution
63 | - [How to...](../../wiki/Usage)
64 | - [Releases and Release Notes](../../releases)
65 | - [Release History](../../wiki/Release-History)
66 | - [Strong naming](../../wiki/Strong-naming)
67 | - [Wiki](../../wiki)
68 | - [License](./LICENSE)
69 |
70 | ## License
71 |
72 | Copyright © Jan Karger, Steven Kirk and Contributors. All rights reserved.
73 |
74 | `GongSolutions.WPF.DragDrop` is provided as-is under the BSD 3-Clause License. For more information see [LICENSE](./LICENSE).
75 |
76 | ## Want to say thanks?
77 |
78 | This framework is free and can be used for free, open source and commercial applications. It's tested, used and contributed by many awesome people. So hit the magic :star: button, we appreciate it!!! :pray:
79 |
80 | [Become a sponsor](https://github.com/sponsors/punker76) and show your support to this open source project.
81 |
82 | If you use `GongSolutions.WPF.DragDrop` as serious task, and you'd like to honor my work on it, please donate, I'll appreciate it.
83 |
84 | Does your company use `GongSolutions.WPF.DragDrop`? Ask your manager or marketing team if your company would be interested in supporting this project. Your company's logo can be shown [on GitHub](https://github.com/punker76/gong-wpf-dragdrop#readme) - who doesn't want a little extra exposure?
85 |
86 | ## In action
87 |
88 | 
89 |
90 | 
91 |
92 | 
93 |
94 | 
95 |
96 | 
97 |
98 | 
99 |
100 | 
101 |
--------------------------------------------------------------------------------
/src/GongSolutions.WPF.DragDrop/Utilities/TypeUtilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Collections;
6 | using System.Collections.ObjectModel;
7 | using JetBrains.Annotations;
8 | using System.Diagnostics;
9 |
10 | namespace GongSolutions.Wpf.DragDrop.Utilities
11 | {
12 | public static class TypeUtilities
13 | {
14 | public static IEnumerable CreateDynamicallyTypedList(IEnumerable source)
15 | {
16 | var sourceObjects = source.Cast