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


C# Microsoft.GetPosition方法代码示例

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


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

示例1: GestureListener_DragCompleted

        private void GestureListener_DragCompleted(object sender, Microsoft.Phone.Controls.DragCompletedGestureEventArgs e)
        {
            double startXCoordinate = e.GetPosition(this.MainCanvas).X - e.HorizontalChange;
            double startYCoordinate = e.GetPosition(this.MainCanvas).Y - e.VerticalChange;

            Point point = new Point(startXCoordinate, startYCoordinate);
            Hex startHex = Game.BoardFactory.GetClosestHex(point);
            Hex targetHex = Game.BoardFactory.GetClosestHex(e.GetPosition(this.MainCanvas));

            if (Game.BoardFactory.AllowDragEvent(startHex, targetHex))
            {
                Game.BoardFactory.HandleDragEvent(targetHex);
            }
        }
开发者ID:jamessdixon,项目名称:PanzerGeneral,代码行数:14,代码来源:Board.xaml.cs

示例2: GestureListener_Tap

 private void GestureListener_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (Game.CurrentViewLevel > 1)
     {
         Hex closestHex = Game.BoardFactory.GetClosestHex(e.GetPosition(this.MainCanvas));
         Game.BoardFactory.HandleTapEvent(closestHex);
     }
 }
开发者ID:jamessdixon,项目名称:PanzerGeneral,代码行数:8,代码来源:Board.xaml.cs

示例3: GestureListener_Hold

 private void GestureListener_Hold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     var pushpinLocation = googlemap.ViewportPointToLocation(e.GetPosition(googlemap));
     Pushpin pushpin = new Pushpin
                           {
                               Location = pushpinLocation,
                               Template = Application.Current.Resources["PushpinControlTemplate"] as ControlTemplate,
                               Content = "1"
                           };
     if (googlemap.Children.Any(p => p is Pushpin))
         googlemap.Children.Remove(googlemap.Children.Single(p => p is Pushpin));
     googlemap.Children.Add(pushpin);
     EnableProceedButton();
 }
开发者ID:ahmednasir91,项目名称:HOP,代码行数:14,代码来源:SellHome.xaml.cs

示例4: ScrollViewer_Tapped

        protected void ScrollViewer_Tapped(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            _offsetAtTap = null;
            _ignoreDoubleTap = false;

            if (HideButtonPanel())
            {
                return;
            }

            if (App.Settings.IsTapIgnored)
            {
                return;
            }

            ScrollViewer scrollViewer = (sender as ScrollViewer);
            scrollViewer.UpdateLayout();
            _offsetAtTap = scrollViewer.VerticalOffset;

            if (scrollViewer != null)
            {
                _handleTap = true;
                Naboo.AppUtil.AsyncCallHelper.DelayCall(
                    () =>
                    {
                        _ignoreDoubleTap = true;

                        if (!_handleTap)
                        {
                            return;
                        }

                        try
                        {
                            Point tapPos = e.GetPosition(scrollViewer);

                            if (tapPos.Y < (scrollViewer.ActualHeight / 6))
                            {
                                scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - (scrollViewer.ActualHeight - 60));
                            }
                            else if (tapPos.Y > (scrollViewer.ActualHeight * 5 / 6))
                            {
                                scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + (scrollViewer.ActualHeight - 60));
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    },
                    300
                    );
            }
        }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:53,代码来源:TopicPageBase.cs

示例5: ScrollViewer_DoubleTapped

        protected void ScrollViewer_DoubleTapped(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            double? offsetAtTap = _offsetAtTap;

            _handleTap = false;
            _offsetAtTap = null;
            if (App.Settings.IsTapIgnored)
            {
                return;
            }

            if (_ignoreDoubleTap)
            {
                return;
            }

            ScrollViewer scrollViewer = (sender as ScrollViewer);

            if (scrollViewer != null)
            {
                Point tapPos = e.GetPosition(scrollViewer);

                if (tapPos.Y < (scrollViewer.ActualHeight / 6))
                {
                    scrollViewer.ScrollToVerticalOffset(0);
                }
                else if (tapPos.Y > (scrollViewer.ActualHeight * 5 / 6))
                {
                    bool foundNextPost = false;
                    //scrollViewer.UpdateLayout();
                    //_topicBodyPanel.UpdateLayout();

                    //if (offsetAtTap.HasValue)
                    //{
                    //    offsetAtTap = offsetAtTap.Value + scrollViewer.ActualHeight;
                    //}
                    //else
                    //{
                    //    offsetAtTap = scrollViewer.VerticalOffset + scrollViewer.ActualHeight;
                    //}

                    //foreach (UIElement control in _firstPostControls)
                    //{
                    //    if (_topicBodyPanel.Children.Contains(control))
                    //    {
                    //        GeneralTransform transformToVisual = control.TransformToVisual(_topicBodyPanel);
                    //        Point controlPos = transformToVisual.Transform(new Point(0, 0));

                    //        if (controlPos.Y > offsetAtTap.Value)
                    //        {
                    //            scrollViewer.ScrollToVerticalOffset(controlPos.Y);
                    //            foundNextPost = true;
                    //            break;
                    //        }
                    //    }
                    //}

                    if (!foundNextPost)
                    {
                        scrollViewer.ScrollToVerticalOffset(double.MaxValue);
                    }
                }
            }
        }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:64,代码来源:TopicPageBase.cs

示例6: myGridGestureListener_DoubleTap

        private void myGridGestureListener_DoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            var point = e.GetPosition(image);
            _relativeMidpoint = new Point(point.X / image.ActualWidth, point.Y / image.ActualHeight);

            var xform = image.TransformToVisual(viewport);
            _screenMidpoint = xform.Transform(point);

            if (_coercedScale >= (_minScale * 2.5) || _coercedScale < 0)
                _coercedScale = _minScale;
            else
                _coercedScale *= 1.75;

            ResizeImage(false);
        }
开发者ID:Synergex,项目名称:Baconography,代码行数:15,代码来源:ScalingGifView.xaml.cs


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