Exemple #1
0
        private void OnTargetPanel_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            if (m_painter == null)
            {
                return;
            }

            // Set focus on target
            if (m_dummyButtonForFocus != null)
            {
                m_dummyButtonForFocus.Focus(FocusState.Programmatic);
            }

            // Track mouse/pointer state
            PointerPoint           currentPoint    = e.GetCurrentPoint(m_painter.TargetPanel);
            PointerPointProperties pointProperties = currentPoint.Properties;

            if (pointProperties.IsPrimary)
            {
                m_stateMouseOrPointer.NotifyButtonStates(
                    pointProperties.IsLeftButtonPressed,
                    pointProperties.IsMiddleButtonPressed,
                    pointProperties.IsRightButtonPressed,
                    pointProperties.IsXButton1Pressed,
                    pointProperties.IsXButton2Pressed);
            }

            // Needed here because we loose focus again by default on left mouse button
            e.Handled = true;
        }
        private void OnTargetPanel_PointerReleased(CoreWindow sender, PointerEventArgs e)
        {
            if (m_painter == null)
            {
                return;
            }

            // Track mouse/pointer state
            PointerPointProperties pointProperties = e.CurrentPoint.Properties;

            if (pointProperties.IsPrimary)
            {
                m_stateMouseOrPointer.NotifyButtonStates(
                    pointProperties.IsLeftButtonPressed,
                    pointProperties.IsMiddleButtonPressed,
                    pointProperties.IsRightButtonPressed,
                    pointProperties.IsXButton1Pressed,
                    pointProperties.IsXButton2Pressed);
            }

            // Needed here because we loose focus again by default on left mouse button
            e.Handled = true;
        }