private Interactive GetTarget(IInputRoot root, Point local) { var target = root.InputHitTest(local)?.GetSelfAndVisualAncestors()?.OfType <Interactive>()?.FirstOrDefault(); if (target != null && DragDrop.GetAllowDrop(target)) { return(target); } return(null); }
private IInputElement SetPointerOver(IPointerDevice device, IInputRoot root, Point p) { Contract.Requires <ArgumentNullException>(device != null); Contract.Requires <ArgumentNullException>(root != null); var element = root.InputHitTest(p); if (element != root.PointerOverElement) { if (element != null) { SetPointerOver(device, root, element); } else { ClearPointerOver(device, root); } } return(element); }