Vidyano.View.LayoutAwarePage.CoreWindow_PointerPressed C# (CSharp) Method

CoreWindow_PointerPressed() private method

Invoked on every mouse click, touch screen tap, or equivalent interaction when this page is active and occupies the entire window. Used to detect browser-style next and previous mouse button clicks to navigate between pages.
private CoreWindow_PointerPressed ( CoreWindow sender, PointerEventArgs args ) : void
sender Windows.UI.Core.CoreWindow Instance that triggered the event.
args Windows.UI.Core.PointerEventArgs Event data describing the conditions that led to the event.
return void
        private void CoreWindow_PointerPressed(CoreWindow sender,
                                               PointerEventArgs args)
        {
            var properties = args.CurrentPoint.Properties;

            // Ignore button chords with the left, right, and middle buttons
            if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed || properties.IsMiddleButtonPressed) return;

            // If back or foward are pressed (but not both) navigate appropriately
            var backPressed = properties.IsXButton1Pressed;
            var forwardPressed = properties.IsXButton2Pressed;
            if (backPressed ^ forwardPressed)
            {
                args.Handled = true;
                if (backPressed)
                    GoBack(this, new RoutedEventArgs());

                if (forwardPressed)
                    GoForward(this, new RoutedEventArgs());
            }
        }