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


C# System.Windows.Input.GestureEventArgs.GetPosition方法代码示例

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


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

示例1: UpperOrLowerPictureTap

        private void UpperOrLowerPictureTap(object sender, GestureEventArgs e)
        {
            var timerValue = int.Parse(TimeTextBlock.Text);

            if (timerValue >= App.ViewModel.TimeDetuctValue) {
                TimeTextBlock.Text = (timerValue - App.ViewModel.TimeDetuctValue).ToString(CultureInfo.InvariantCulture);
                DeductTimeTextBlock.Text = "-" + App.ViewModel.TimeDetuctValue;
                RadAnimationManager.Play(DeductTimeTextBlock, TimerDeductAnimation(), () => DeductTimeTextBlock.Text = string.Empty);
            }
            _wrongSoundEffect.Play();

            var point = e.GetPosition(sender as UIElement);

            var r1 = new Rectangle { Fill = new SolidColorBrush(Colors.Red) { Opacity = 1 }, Width = 16, Height = 16 };
            Canvas.SetLeft(r1, point.X - 8);
            Canvas.SetTop(r1, point.Y - 8);
            UpperPictureCanvas.Children.Add(r1);

            var r2 = new Rectangle { Fill = new SolidColorBrush(Colors.Red) { Opacity = 1 }, Width = 16, Height = 16 };
            Canvas.SetLeft(r2, point.X - 8);
            Canvas.SetTop(r2, point.Y - 8);
            LowerPictureCanvas.Children.Add(r2);

            RadAnimationManager.Play(r1, _tapWrongAnimation, () => UpperPictureCanvas.Children.Remove(r1));
            RadAnimationManager.Play(r2, _tapWrongAnimation, () => LowerPictureCanvas.Children.Remove(r2));
        }
开发者ID:NBitionDevelopment,项目名称:WindowsPhonePhotoHuntAnimal,代码行数:26,代码来源:GamePage.xaml.cs

示例2: Map_OnTap

        private void Map_OnTap(object sender, GestureEventArgs e) {
            e.Handled = true;

            Point clickLocation = e.GetPosition(Map);
            GeoCoordinate coordinate = Map.ConvertViewportPointToGeoCoordinate(clickLocation);
            
//            AddPushpin(coordinate);
        }
开发者ID:Grief-Code,项目名称:kilogram,代码行数:8,代码来源:MapViewPage.xaml.cs

示例3: Map_OnTap

        private void Map_OnTap(object sender, GestureEventArgs e) {
            Point clickLocation = e.GetPosition(Map);
            GeoCoordinate coordinate = Map.ConvertViewportPointToGeoCoordinate(clickLocation);

            SetPushpin(coordinate);

            ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true; 
        }
开发者ID:Grief-Code,项目名称:kilogram,代码行数:8,代码来源:MapPickPage.xaml.cs


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