当前位置: 首页>>代码示例>>C#>>正文


C# Input.TouchEventArgs类代码示例

本文整理汇总了C#中System.Windows.Input.TouchEventArgs的典型用法代码示例。如果您正苦于以下问题:C# TouchEventArgs类的具体用法?C# TouchEventArgs怎么用?C# TouchEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TouchEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了TouchEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleTouch

 private void HandleTouch(TouchEventArgs e)
 {
     var visual = GetTouchVisual(e.TouchDevice.Id);
     var point = e.GetTouchPoint(this.fingerCanvas).Position;
     visual.SetValue(Canvas.LeftProperty, point.X);
     visual.SetValue(Canvas.TopProperty, point.Y);
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:7,代码来源:ManipulationWindow.xaml.cs

示例2: Button_TouchDown

 private void Button_TouchDown(object sender, TouchEventArgs e)
 {
     e.Handled = true;
  //   e.RoutedEvent.RoutingStrategy = RoutingStrategy.Direct;
     Config.WriteXml(App.config, "config.xml");
     this.NavigationService.GoBack();
 }
开发者ID:ufjl0683,项目名称:LedControlPanel,代码行数:7,代码来源:GroupDevice.xaml.cs

示例3: MotionButton_TouchEnter

        private void MotionButton_TouchEnter(object sender, TouchEventArgs e)
        {
            StartTimer();
            _lastTouchDevice = e.Device;

            ScaleDown();
        }
开发者ID:smalice,项目名称:SurfaceGlobus,代码行数:7,代码来源:MotionButton.cs

示例4: RecordTouchDown

 private void RecordTouchDown(object sender, TouchEventArgs e)
 {
     _touchPoints++;
     _recordRotation = true;
     System.Windows.Input.TouchPoint touchPoint = e.GetTouchPoint(this);
     System.Windows.Point point = touchPoint.Position;
     _recordY = point.Y;
     if (_touchPoints == 2)
     {
         if (!_isPlaying)
         {
             channel.PlaySample();
             _isPlaying = true;
         }
         else
         {
             channel.StopSample();
             _isPlaying = false;
         }
         _twoTouchLock = true;
     }
     if (_touchPoints == 1)
     {
         if (channel.IsPlaying())
             channel.Pause();
     }
 }
开发者ID:GunioRobot,项目名称:Project-Volcano,代码行数:27,代码来源:DeckControl.cs

示例5: OnMoreInfoImageTouched

 private void OnMoreInfoImageTouched(object sender, TouchEventArgs e)
 {
     System.Windows.Controls.Image img = e.OriginalSource as System.Windows.Controls.Image;
     if (img == null) return;
     OpenWithTask.ShowDetail(img);
     e.Handled = true;
 }
开发者ID:pankajbhandari08,项目名称:windows-tweaker,代码行数:7,代码来源:OpenWith.xaml.cs

示例6: LessonContainer_TouchDown

        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();
            }
        }
开发者ID:aragoubi,项目名称:Nine,代码行数:31,代码来源:QuestionsPage.xaml.cs

示例7: ButtonPin_TouchUp

 private void ButtonPin_TouchUp(object sender, TouchEventArgs e)
 {
     // TagRemovedBehavior = TagRemovedBehavior.Persist;
     ButtonPin.Visibility = Visibility.Hidden;
     isPinned = true;
     PinButtonClicked(this, e);
 }
开发者ID:NikolajMos,项目名称:Image-Exchange-System,代码行数:7,代码来源:CameraVisualization.xaml.cs

示例8: OnTouchDown

 protected override void OnTouchDown(TouchEventArgs e)
 {
     this.CaptureTouch(e.TouchDevice);
     card.CardControler.TouchDownCard(this,e);
     e.Handled = true;
     base.OnTouchDown(e);
 }
开发者ID:nius1989,项目名称:CardDataSorting,代码行数:7,代码来源:Linking_Icon.xaml.cs

示例9: ScrollViewer_PreviewTouchUp

        /// <summary>
        /// Handles the PreviewTouchUp event of the ScrollViewer control.
        /// </summary>
        /// <param name="sender">Event source</param>
        /// <param name="e">Event argument</param>
        private void ScrollViewer_PreviewTouchUp(object sender, TouchEventArgs e)
        {
            try
            {
                var touchEnd = e.GetTouchPoint(this);

                var scrollviewer = sender as ScrollViewer;

                double distance = touchEnd.Position.Y - this.touchStartForScrollViewer.Position.Y;

                if (Math.Abs(distance) > ThresholdDistanceForSwipe)
                {
                    if (distance > 0)
                    {
                        if (scrollviewer != null)
                        {
                            scrollviewer.PageUp();
                        }
                    }
                    else
                    {
                        if (scrollviewer != null)
                        {
                            scrollviewer.PageDown();
                        }
                    }
                }

                e.Handled = true;
            }
            catch
            {
                // Do nothing.
            }
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:40,代码来源:HistoryDetailsUserControl.xaml.cs

示例10: touchDown

        /// <summary>
        /// Event triggered when the NoteBubbleGenerator is touch.
        /// Generates a new NoteBubble according to the MostNeeded algorithm.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">TouchEventArgs</param>
        public void touchDown(object sender, TouchEventArgs e)
        {
            if (GlobalVariables.MaxMelodyBubbles > MelodyBubbleVMs.Count)
            {
                List<MelodyBubble> bubblesList = new List<MelodyBubble>();
                foreach (MelodyBubbleViewModel nbvm in MelodyBubbleVMs)
                    bubblesList.Add(nbvm.MelodyBubble);
                MelodyBubble newBubble = MelodyBubbleGenerator.CreateMelodyBubble(bubblesList);
                MelodyBubbleViewModel mbVM = new MelodyBubbleViewModel(newBubble, SessionVM.Bubbles, SessionVM);
                MelodyBubbleVMs.Add(mbVM);
                SessionVM.Bubbles.Items.Add(mbVM.SVItem);
            }
            else
            {
                MelodyBubbleViewModel toRemove = MelodyBubbleVMs.First();
                MelodyBubbleVMs.Remove(toRemove);
                SessionVM.Bubbles.Items.Remove(toRemove.SVItem);
                List<MelodyBubble> bubblesList = new List<MelodyBubble>();
                foreach (MelodyBubbleViewModel nbvm in MelodyBubbleVMs)
                    bubblesList.Add(nbvm.MelodyBubble);
                MelodyBubble newBubble = MelodyBubbleGenerator.CreateMelodyBubble(bubblesList);
                MelodyBubbleViewModel mbVM = new MelodyBubbleViewModel(newBubble, SessionVM.Bubbles, SessionVM);
                MelodyBubbleVMs.Add(mbVM);
                SessionVM.Bubbles.Items.Add(mbVM.SVItem);
            }

            String effect = "pop" + (new Random()).Next(1, 5).ToString();
            AudioController.PlaySoundWithString(effect);
        }
开发者ID:Acemond,项目名称:PopNTouch,代码行数:35,代码来源:MelodyBubbleGeneratorViewModel.cs

示例11: OnTouchUp

        protected override void OnTouchUp(TouchEventArgs e)
        {
            _currentAngle = _currentAngle + _angle;

            //Pass the message up
            base.OnTouchUp(e);
        }
开发者ID:GunioRobot,项目名称:Project-Volcano,代码行数:7,代码来源:KnobControl.cs

示例12: UcPhotoContactTap

        private void UcPhotoContactTap(object sender, TouchEventArgs e)
        {
            if (Feature is PhotoFeature)
            {
                var pf = (PhotoFeature) Feature;
                var fe = new FloatingElement
                             {
                                 Document = new Document {FileType = FileTypes.image, Location = pf.ImageUrl},
                                 OpacityDragging = 0.5,
                                 OpacityNormal = 1.0,
                                 CanMove = true,
                                 CanRotate = true,
                                 CanScale = true,
                                 StartOrientation = e.Device.GetOrientation(Application.Current.MainWindow) + 90,
                                 Background = Brushes.DarkOrange,
                                 MaxSize = new Size(500, (500.0/pf.Width)*pf.Height),
                                 StartPosition = e.TouchDevice.GetTouchPoint(Application.Current.MainWindow).Position,
                                 StartSize = new Size(200, (200.0/pf.Width)*pf.Height),
                                 MinSize = new Size(100, (100.0/pf.Width)*pf.Height),
                                 ShowsActivationEffects = false,
                                 RemoveOnEdge = true,
                                 Contained = true,
                                 Title = pf.Name,
                                 Foreground = Brushes.White,
                                 DockingStyle = DockingStyles.None,
                             };
                AppStateSettings.Instance.FloatingItems.Add(fe);
                //State.AddFloatingElement(new CoFile() { Location = pf.ImageUrl, Id = pf.Id, Name = pf.Name }, (pf.Width/2), (pf.Height/2));
            }

        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:31,代码来源:ucPhoto.xaml.cs

示例13: OnPreviewTouchDown

 protected override void OnPreviewTouchDown(TouchEventArgs e)
 {
     // Release any previous capture
     this.ReleaseCurrentDevice();
     // Capture the new touch
     this.CaptureCurrentDevice(e);
 }
开发者ID:gencer,项目名称:MahApps.Metro,代码行数:7,代码来源:MetroThumb.cs

示例14: OnTouchDown

        } //

        public void OnTouchDown(object xSender, TouchEventArgs e)
        {
            Canvas lCanvas = xSender as Canvas;
            if (lCanvas == null) return;

            TouchPoint lTouchPoint = e.GetTouchPoint(lCanvas);
            if (lTouchPoint == null) return;

            myTuple lTuple = _PointA;
            if (lTuple != null)
            {
                if (lTuple.Item1 == e.TouchDevice.Id) return; // this was finger 1, not going to happen anyway as it cannot touchdown twice
                Point lPointA = lTuple.Item2;

                // store second finger; we don't care about its ID, so it could also be finger 3, 4 or 5 ...
                Point lPointB = lTouchPoint.Position;
                _PointB = new myTuple(e.TouchDevice.Id, lPointB);
                RedrawRectangle(lPointA, lPointB);
                return;
            }

            // first finger
            DrawNewRectangle(lCanvas, lTouchPoint.Position, lTouchPoint.TouchDevice.Id);
            return;
        } //
开发者ID:huoxudong125,项目名称:HQF.Tutorial.WPF,代码行数:27,代码来源:Zoom.cs

示例15: OnTouchMove

        private void OnTouchMove(object sender, TouchEventArgs e)
        {
            if (!_AlreadySwiped)
            {

                var touch = e.GetTouchPoint(_ParentControl);

                //right now a swipe is 200 pixels

                //Swipe Left
                if (_TouchStart != null && touch.Position.X > (_TouchStart.Position.X + 200))
                {
                    if (OnSwipeLeft != null)
                        OnSwipeLeft(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }

                //Swipe Right
                if (_TouchStart != null && touch.Position.X < (_TouchStart.Position.X - 200))
                {
                    if (OnSwipeRight != null)
                        OnSwipeRight(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }
            }
            //e.Handled = true;
        }
开发者ID:aert,项目名称:aert-csharp-extensions,代码行数:29,代码来源:SwipeHelper.cs


注:本文中的System.Windows.Input.TouchEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。