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


C# DoubleTappedRoutedEventArgs.GetPosition方法代码示例

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


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

示例1: OnDoubleTapped

        private async void OnDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (GameClient == null)
                return;

            var position = e.GetPosition(canvas);
            await PerformBasicTouchNavigation(canvas, position.ToVector2());
        }
开发者ID:SvenEV,项目名称:OrangeBugReloaded,代码行数:8,代码来源:OrangeBugPresenter.xaml.cs

示例2: image_DoubleTapped

        private void image_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            //Get the precise pointer position at the time of doubletap in order to center the view at that location
            p = e.GetPosition(sender as Image);
            //set the internal flag to track the doubletapped gesture
            isDoubleTapped = true;

        }
开发者ID:mbin,项目名称:Win81App,代码行数:8,代码来源:Scenario1.xaml.cs

示例3: Image_DoubleTapped

		public void Image_DoubleTapped(object sender, DoubleTappedRoutedEventArgs args)
		{
			var point = args.GetPosition((UIElement)sender);
			this.Model.ZoomIn(point.X, point.Y);

			this.DrawMandelbrot();
		}
开发者ID:umebayashi,项目名称:CLR,代码行数:7,代码来源:MandelbrotViewModel.cs

示例4: Img_DoubleTapped

        private void Img_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            tapped_times = 2;

            if (this.sv.ZoomFactor == this.sv.MinZoomFactor)
            {
                var appView = ApplicationView.GetForCurrentView();

                var point = e.GetPosition(Window.Current.Content);
                var point1 = e.GetPosition(Img);
                var point2 = e.GetPosition(sv);

                double X, Y, deltaX, deltaY;
                deltaX = (appView.VisibleBounds.Width - Img.ActualWidth) / 2;
                deltaY = (appView.VisibleBounds.Height - Img.ActualHeight) / 2;
                X = point.X - deltaX;
                Y = point.Y - deltaY;

                this.sv.ZoomToFactor(this.sv.MaxZoomFactor);

                sv.ScrollToHorizontalOffset(X * (this.sv.MaxZoomFactor - 1) - deltaX);
                sv.ScrollToVerticalOffset(Y * (this.sv.MaxZoomFactor - 1) - deltaY);
            }
            else
            {
                this.sv.ZoomToFactor(this.sv.MinZoomFactor);
            }


            e.Handled = true;
            tapped_times = 0;
        }
开发者ID:chenjianwp,项目名称:UWP_ToolKit_CommonLibrary,代码行数:32,代码来源:PreviewPictureControl.xaml.cs

示例5: GameBoardScrollViewer_OnDoubleTapped

        private void GameBoardScrollViewer_OnDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            var zoomPoint = e.GetPosition(GameBoardScrollViewer);
            GameBoardScrollViewer.ScrollToHorizontalOffset(zoomPoint.X);
            GameBoardScrollViewer.ScrollToVerticalOffset(zoomPoint.Y);

            GameBoardScrollViewer.ZoomToFactor(GameBoardScrollViewer.ZoomFactor > 1.5f ? .5f : 2.0f);
        }
开发者ID:jonathanyeung,项目名称:ozwego,代码行数:8,代码来源:GameBoardPrototype.xaml.cs

示例6: ImageDoubleTapped

        private async void ImageDoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (sender != null && !string.IsNullOrEmpty(ViewModel.TranslationFile))
            {
                if (!await FileUtils.HaveAyaPositionFile())
                {
                    await ViewModel.DownloadAyahPositionFile();
                }

                var cachedImage = sender as CachedImage;
                if (cachedImage == null)
                    return;

                var ayah = await CachedImage.GetAyahFromGesture(e.GetPosition(cachedImage.Image),
                                                          ViewModel.CurrentPageNumber,
                                                          radSlideView.ActualWidth);
                var currentPage = ViewModel.CurrentPage;
                if (currentPage != null)
                {
                    ViewModel.SelectedAyah = ayah;
                    if (await ViewModel.HasTranslationFile())
                    {
                        ViewModel.ShowTranslation = !ViewModel.ShowTranslation;
                        SettingsUtils.Set(Constants.PREF_SHOW_TRANSLATION, ViewModel.ShowTranslation);
                    }
                }
            }
        }
开发者ID:hubaishan,项目名称:quran-phone,代码行数:28,代码来源:DetailsView.xaml.cs


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