-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
PlatformDragEventArgs.cs
96 lines (82 loc) · 2.54 KB
/
PlatformDragEventArgs.cs
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
namespace Microsoft.Maui.Controls;
/// <summary>
/// Platform-specific arguments associated with the <see cref="DragEventArgs"/>.
/// </summary>
public class PlatformDragEventArgs
{
#if IOS || MACCATALYST
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public UIKit.UIView? Sender { get; }
/// <summary>
/// Gets the interaction used for dropping items.
/// </summary>
public UIKit.UIDropInteraction DropInteraction { get; }
/// <summary>
/// Gets the associated information from the drop session.
/// </summary>
public UIKit.IUIDropSession DropSession { get; }
internal UIKit.UIDropProposal? DropProposal { get; private set; }
internal PlatformDragEventArgs(UIKit.UIView? sender, UIKit.UIDropInteraction dropInteraction,
UIKit.IUIDropSession dropSession)
{
Sender = sender;
DropInteraction = dropInteraction;
DropSession = dropSession;
}
/// <summary>
/// Sets the drop proposal when dragging over a view.
/// </summary>
/// <param name="dropProposal">The custom drop proposal to use.</param>
/// <remarks>
/// <see cref="PlatformDragEventArgs"/> is used for DragOver and DragLeave events, but this method
/// only has an effect with DragOver events.
/// </remarks>
public void SetDropProposal(UIKit.UIDropProposal dropProposal)
{
DropProposal = dropProposal;
}
#elif ANDROID
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Android.Views.View Sender { get; }
/// <summary>
/// Gets the event containing information for drag and drop status.
/// </summary>
public Android.Views.DragEvent DragEvent { get; }
internal PlatformDragEventArgs(Android.Views.View sender, Android.Views.DragEvent dragEvent)
{
Sender = sender;
DragEvent = dragEvent;
}
#elif WINDOWS
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public Microsoft.UI.Xaml.UIElement? Sender { get; }
/// <summary>
/// Gets data for drag and drop events.
/// </summary>
public Microsoft.UI.Xaml.DragEventArgs DragEventArgs { get; }
/// <summary>
/// Gets or sets a value that indicates whether the DragEventArgs are changed.
/// </summary>
/// <remarks>
/// Set the value of this property to true when changing the DragEventArgs so the system does not override the changes.
/// </remarks>
public bool Handled { get; set; }
internal PlatformDragEventArgs(Microsoft.UI.Xaml.UIElement? sender,
Microsoft.UI.Xaml.DragEventArgs dragEventArgs)
{
Sender = sender;
DragEventArgs = dragEventArgs;
}
#else
internal PlatformDragEventArgs()
{
}
#endif
}