|
@@ -11,7 +11,7 @@ namespace Avalonia.Input
|
|
|
|
|
|
|
|
private Interactive _lastTarget = null;
|
|
private Interactive _lastTarget = null;
|
|
|
|
|
|
|
|
- private Interactive GetTarget(IInputElement root, Point local)
|
|
|
|
|
|
|
+ private Interactive GetTarget(IInputRoot root, Point local)
|
|
|
{
|
|
{
|
|
|
var target = root.InputHitTest(local)?.GetSelfAndVisualAncestors()?.OfType<Interactive>()?.FirstOrDefault();
|
|
var target = root.InputHitTest(local)?.GetSelfAndVisualAncestors()?.OfType<Interactive>()?.FirstOrDefault();
|
|
|
if (target != null && DragDrop.GetAllowDrop(target))
|
|
if (target != null && DragDrop.GetAllowDrop(target))
|
|
@@ -19,7 +19,7 @@ namespace Avalonia.Input
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private DragDropEffects RaiseDragEvent(Interactive target, IInputElement inputRoot, Point point, RoutedEvent<DragEventArgs> routedEvent, DragDropEffects operation, IDataObject data, InputModifiers modifiers)
|
|
|
|
|
|
|
+ private DragDropEffects RaiseDragEvent(Interactive target, IInputRoot inputRoot, Point point, RoutedEvent<DragEventArgs> routedEvent, DragDropEffects operation, IDataObject data, InputModifiers modifiers)
|
|
|
{
|
|
{
|
|
|
if (target == null)
|
|
if (target == null)
|
|
|
return DragDropEffects.None;
|
|
return DragDropEffects.None;
|
|
@@ -38,13 +38,13 @@ namespace Avalonia.Input
|
|
|
return args.DragEffects;
|
|
return args.DragEffects;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private DragDropEffects DragEnter(IInputElement inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
|
|
|
|
+ private DragDropEffects DragEnter(IInputRoot inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
{
|
|
{
|
|
|
_lastTarget = GetTarget(inputRoot, point);
|
|
_lastTarget = GetTarget(inputRoot, point);
|
|
|
return RaiseDragEvent(_lastTarget, inputRoot, point, DragDrop.DragEnterEvent, effects, data, modifiers);
|
|
return RaiseDragEvent(_lastTarget, inputRoot, point, DragDrop.DragEnterEvent, effects, data, modifiers);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private DragDropEffects DragOver(IInputElement inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
|
|
|
|
+ private DragDropEffects DragOver(IInputRoot inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
{
|
|
{
|
|
|
var target = GetTarget(inputRoot, point);
|
|
var target = GetTarget(inputRoot, point);
|
|
|
|
|
|
|
@@ -77,7 +77,7 @@ namespace Avalonia.Input
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private DragDropEffects Drop(IInputElement inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
|
|
|
|
+ private DragDropEffects Drop(IInputRoot inputRoot, Point point, IDataObject data, DragDropEffects effects, InputModifiers modifiers)
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
@@ -100,16 +100,16 @@ namespace Avalonia.Input
|
|
|
switch (e.Type)
|
|
switch (e.Type)
|
|
|
{
|
|
{
|
|
|
case RawDragEventType.DragEnter:
|
|
case RawDragEventType.DragEnter:
|
|
|
- e.Effects = DragEnter(e.InputRoot, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
|
|
|
|
+ e.Effects = DragEnter(e.Root, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
break;
|
|
break;
|
|
|
case RawDragEventType.DragOver:
|
|
case RawDragEventType.DragOver:
|
|
|
- e.Effects = DragOver(e.InputRoot, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
|
|
|
|
+ e.Effects = DragOver(e.Root, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
break;
|
|
break;
|
|
|
case RawDragEventType.DragLeave:
|
|
case RawDragEventType.DragLeave:
|
|
|
- DragLeave(e.InputRoot);
|
|
|
|
|
|
|
+ DragLeave(e.Root);
|
|
|
break;
|
|
break;
|
|
|
case RawDragEventType.Drop:
|
|
case RawDragEventType.Drop:
|
|
|
- e.Effects = Drop(e.InputRoot, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
|
|
|
|
+ e.Effects = Drop(e.Root, e.Location, e.Data, e.Effects, e.Modifiers);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|