本文整理汇总了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));
}
示例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);
}
示例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;
}