void IOverlay.ProcessPointerRelease(PointerEventArgs e) { // If an element as captured the pointer, send the event to it first if (CaptureElement != null) { e.Handled = CaptureElement.ProcessPointerRelease(e); } if (e.Handled) { return; } //Proceeds with the rest foreach (UIElement control in TreeTraversal.PostOrderInteractionVisit(this)) { e.Handled = control.ProcessPointerRelease(e); if (e.Handled) { break; } } if (e.Handled) { return; } ProcessPointerRelease(e); e.Handled = true; }
void IDesktopOverlay.ProcessKeyDown(KeyEventArgs e) { // If an element as captured the pointer, send the event to it first if (CaptureElement != null) { e.Handled = CaptureElement.ProcessKeyDown(e); } if (e.Handled) { return; } // Then, send it to the currently focused control if (FocusedElement != null) { e.Handled = FocusedElement.ProcessKeyDown(e); } if (e.Handled) { return; } //Proceeds with the rest foreach (UIElement control in TreeTraversal.PostOrderInteractionVisit(this)) { e.Handled = control.ProcessKeyDown(e); if (e.Handled) { break; } } if (e.Handled) { return; } e.Handled = ProcessKeyDown(e); }
public UIElement Find(Vector2 cursorLocation) { return(TreeTraversal.PostOrderInteractionVisit(this) .Reverse() .FirstOrDefault(control => control.Contains(cursorLocation))); }