Exemple #1
0
        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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public UIElement Find(Vector2 cursorLocation)
 {
     return(TreeTraversal.PostOrderInteractionVisit(this)
            .Reverse()
            .FirstOrDefault(control => control.Contains(cursorLocation)));
 }