-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDragDropHelper.cs
More file actions
29 lines (24 loc) · 1.06 KB
/
DragDropHelper.cs
File metadata and controls
29 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Windows;
using TensorStack.WPF.Controls;
namespace TensorStack.WPF.Utils
{
public static class DragDropHelper
{
public static DragDropEffects DoDragDropFile(DependencyObject dragSource, string filepath, DragDropType dropType, UIElement visual = null, double visualScale = 1)
{
if (Application.Current.MainWindow is WindowMainBase mainWindow)
{
return mainWindow.DoDragDropFile(dragSource, filepath, dropType, visual, visualScale);
}
throw new System.Exception("WindowMainBase not found");
}
public static DragDropEffects DoDragDropObject<T>(DependencyObject dragSource, T dropData, DragDropType dropType, UIElement visual = null, double visualScale = 1)
{
if (Application.Current.MainWindow is WindowMainBase mainWindow)
{
return mainWindow.DoDragDropObject<T>(dragSource, dropData, dropType, visual, visualScale);
}
throw new System.Exception("WindowMainBase not found");
}
}
}