• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Input.TouchEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: MriList_PreviewTouchDown

        private void MriList_PreviewTouchDown(object sender, TouchEventArgs e)
        {
            FrameworkElement findSource = e.OriginalSource as FrameworkElement;
            SurfaceListBoxItem draggedElement = null;

            // Find the touched SurfaceListBoxItem object.
            while (draggedElement == null && findSource != null)
            {
                if ((draggedElement = findSource as SurfaceListBoxItem) == null)
                {
                    findSource = VisualTreeHelper.GetParent(findSource) as FrameworkElement;
                }
            }

            if (draggedElement == null)
            {
                return;
            }

            // Create the cursor visual.
            ContentControl cursorVisual = new ContentControl()
            {
                Content = draggedElement.DataContext,
                Style = FindResource("CursorStyle") as Style
            };

            // Add a handler. This will enable the application to change the visual cues.
            SurfaceDragDrop.AddTargetChangedHandler(cursorVisual, OnTargetChanged);

            // Create a list of input devices. Add the touches that
            // are currently captured within the dragged element and
            // the current touch (if it isn't already in the list).
            List<InputDevice> devices = new List<InputDevice>();
            devices.Add(e.TouchDevice);
            foreach (TouchDevice touch in draggedElement.TouchesCapturedWithin)
            {
                if (touch != e.TouchDevice)
                {
                    devices.Add(touch);
                }
            }

            // Get the drag source object
            ItemsControl dragSource = ItemsControl.ItemsControlFromItemContainer(draggedElement);

            SurfaceDragCursor startDragOkay =
                SurfaceDragDrop.BeginDragDrop(
                  dragSource,                 // The SurfaceListBox object that the cursor is dragged out from.
                  draggedElement,             // The SurfaceListBoxItem object that is dragged from the drag source.
                  cursorVisual,               // The visual element of the cursor.
                  draggedElement.DataContext, // The data associated with the cursor.
                  devices,                    // The input devices that start dragging the cursor.
                  DragDropEffects.Move);      // The allowed drag-and-drop effects of the operation.

            // If the drag began successfully, set e.Handled to true.
            // Otherwise SurfaceListBoxItem captures the touch
            // and causes the drag operation to fail.
            e.Handled = (startDragOkay != null);
        }
开发者ID:ase-lab,项目名称:MRITable2,代码行数:59,代码来源:PatientInformation.xaml.cs


示例17: OnPreviewTouchDown

        protected override void OnPreviewTouchDown(TouchEventArgs e)
        {
            //오브젝트 선택
            TouchPoint pt = e.GetTouchPoint(this);
            this.HitTestHelper.SelectItemAt(pt.Position);

            base.OnPreviewTouchDown(e);
        }
开发者ID:habs57,项目名称:tablet-interaction,代码行数:8,代码来源:SlideListBox.cs


示例18: OnTouchDown

        protected override void OnTouchDown(TouchEventArgs e)
        {
            _touchOrigin = e.TouchDevice.GetTouchPoint(this).Position;
            _angle = 0;

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


示例19: layoutRoot_TouchDown

        public void layoutRoot_TouchDown(object sender, TouchEventArgs e)
        {
            TouchPoint p = e.GetTouchPoint(GestureFramework.LayoutRoot);
            TouchInfo info = p.ToTouchInfo();
            UIElement source = e.OriginalSource as UIElement;

            base.AddNewTouchPoint(info, source);
        }
开发者ID:tuliosouza,项目名称:ASG,代码行数:8,代码来源:Windows7TouchInputProvider.cs


示例20: CaptureCurrentDevice

 private void CaptureCurrentDevice(TouchEventArgs e)
 {
     var gotTouch = CaptureTouch(e.TouchDevice);
     if (gotTouch)
     {
         _currentDevice = e.TouchDevice;
     }
 }
开发者ID:LionFree,项目名称:Cush,代码行数:8,代码来源:CushThumb.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Input.TraversalRequest类代码示例发布时间:2022-05-26
下一篇:
C# Input.TextCompositionEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap