public async Task ClickSuppressedOnMouseUpWithinChild2()
        {
            // Agg currently fires mouse up events in child controls when the parent has the mouse captured
            // and is performing drag like operations. If the mouse goes down in the parent and comes up on the child
            // neither control should get a click event

            var testWindow        = new ClickTestsWindow(300, 200);
            var bounds            = testWindow.BlueWidget.BoundsRelativeToParent;
            var mouseDownPosition = new Vector2(bounds.Left + 25, bounds.Bottom + 4);

            var    childBounds = testWindow.OrangeWidget.BoundsRelativeToParent;
            double childX      = bounds.Left + childBounds.Center.X;
            double childY      = bounds.Bottom + childBounds.Center.Y;

            await AutomationRunner.ShowWindowAndExecuteTests(
                testWindow,
                (testRunner) =>
            {
                MouseEventArgs mouseEvent;

                // ** Click should occur on mouse[down/up] within the controls bounds **
                //
                // Move to a position within BlueWidget for mousedown
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, mouseDownPosition.X, mouseDownPosition.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseDown(mouseEvent);

                // Move to a position within BlueWidget for mouseup
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, bounds.Center.X, bounds.Center.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseUp(mouseEvent);

                Assert.AreEqual(1, testWindow.BlueWidget.ClickCount, "Expected 1 click on root widget");

                // ** Click should not occur when mouse up occurs on child controls **
                //
                // Move to a position within BlueWidget for mousedown
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, mouseDownPosition.X, mouseDownPosition.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseDown(mouseEvent);

                // Move to a position with the OrangeWidget for mouseup
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, childX, childY, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseUp(mouseEvent);

                // There should be no increment in the click count
                Assert.AreEqual(1, testWindow.BlueWidget.ClickCount, "Expected click count to not increment on mouse up within child control");

                return(Task.CompletedTask);
            });
        }
        public async Task ClickSuppressedOnExternalMouseUp()
        {
            var testWindow        = new ClickTestsWindow(300, 200);
            var bounds            = testWindow.BlueWidget.BoundsRelativeToParent;
            var mouseDownPosition = new Vector2(bounds.Left + 25, bounds.Bottom + 4);

            await AutomationRunner.ShowWindowAndExecuteTests(
                testWindow,
                (testRunner) =>
            {
                MouseEventArgs mouseEvent;

                // ** Click should occur on mouse[down/up] within the controls bounds **
                //
                // Move to a position within the blueWidget for mousedown
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, mouseDownPosition.X, mouseDownPosition.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseDown(mouseEvent);

                // Move to a position within blueWidget for mouseup
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, bounds.Center.X, bounds.Center.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseUp(mouseEvent);

                Assert.AreEqual(1, testWindow.BlueWidget.ClickCount, "Expected 1 click on root widget");

                // ** Click should not occur when mouse up is outside of the control bounds **
                //
                // Move to a position within BlueWidget for mousedown
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, mouseDownPosition.X, mouseDownPosition.Y, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseDown(mouseEvent);

                // Move to a position **outside** of BlueWidget for mouseup
                mouseEvent = new MouseEventArgs(MouseButtons.Left, 1, 50, 50, 0);
                testRunner.SetMouseCursorPosition(testWindow, (int)mouseEvent.X, (int)mouseEvent.Y);
                testWindow.OnMouseUp(mouseEvent);

                // There should be no increment in the click count
                Assert.AreEqual(1, testWindow.BlueWidget.ClickCount, "Expected 1 click on root widget");

                return(Task.CompletedTask);
            });
        }