コード例 #1
0
        private async void LessonContainer_TouchDown(object sender, TouchEventArgs e)
        {
            // Forward touch events to container
            //FrameworkElement control = sender as FrameworkElement;
            //control.CaptureTouch(e.TouchDevice);
            if (LayerStackDC.CurrentState.FingerInkingEnabled)
            {
                LessonContainer.IsContentManipulationEnabled = false;
                return;
            }

            // Saves current touch information
            //touchDevices.Add(e.TouchDevice);
            touchOrigin = e.GetTouchPoint(LessonContainer).Position;

            // Disable manipulation/drawing
            //LessonContainer.IsContentManipulationEnabled = false;
            LayerStackDC.ContainerTouchDown();

            // If touch-and-hold (within 10px radius circle, over 500ms)
            if (await TouchHelper.TouchHold(e, LessonContainer, 500, 10))
            {
                // Opens RadialMenu
                LessonContainer.IsContentManipulationEnabled = false;
                LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(),
                                            e.GetTouchPoint(LessonContainer).Position, RadialMenuState.Levels.Main);

                // Un-forward touch events to container
                //control.ReleaseAllTouchCaptures();
            }
        }
コード例 #2
0
 private async void LessonContainer_StylusDown(object sender, StylusDownEventArgs e)
 {
     // If touch-and-hold (within 9px radius circle, over 700ms)
     if (await TouchHelper.StylusHold(e, LessonContainer, 700, 9))
     {
         // Opens RadialMenu
         LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(), e.GetPosition(LessonContainer),
                                     RadialMenuState.Levels.Main);
     }
 }
コード例 #3
0
        private void LessonContainer_TouchUp(object sender, TouchEventArgs e)
        {
            // Un-forward touch events to container
            //FrameworkElement control = sender as FrameworkElement;
            //control.ReleaseTouchCapture(e.TouchDevice);
            //LessonContainer.ContentReleaseTouchCapture(e.TouchDevice);
            //LessonContainer.IsContentManipulationEnabled = false;
            //e.Handled = true;
            if (LayerStackDC.CurrentState.FingerInkingEnabled)
            {
                LessonContainer.IsContentManipulationEnabled = true;
                return;
            }

            // Re-enable manipulation/drawing
            LayerStackDC.ContainerTouchUp();
            LessonContainer.IsContentManipulationEnabled = true;
        }
コード例 #4
0
 private void LessonContent_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     // Opens RadialMenu
     LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(), e.GetPosition(LessonContainer),
                                 RadialMenuState.Levels.Main);
 }