當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。