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


C# HoldingRoutedEventArgs.GetPosition方法代码示例

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


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

示例1: ImageToAdd_Holding

 private void ImageToAdd_Holding(object sender, HoldingRoutedEventArgs e)
 {
     if (sender.GetType() == typeof(Image))
         ImageToAdd_CreateDropDownMenu(sender as Image, e.GetPosition(sender as Image));
     else
         throw new Exception("Error: Expected sender to be Image but was: " + sender.GetType().ToString());
 }
开发者ID:tomazio21,项目名称:DocFingerPrinterBeta,代码行数:7,代码来源:FilesPage.xaml.cs

示例2: LayoutRoot_Holding

 private void LayoutRoot_Holding(object sender, HoldingRoutedEventArgs e)
 {
     if (e.HoldingState != Windows.UI.Input.HoldingState.Started)
         return;
     IsHolding = true;
     var targetElement = sender as FrameworkElement;
     MenuFlyout flyout = (MenuFlyout)FlyoutBase.GetAttachedFlyout(targetElement);
     flyout.ShowAt(targetElement, e.GetPosition(targetElement));          
 }
开发者ID:akshay2000,项目名称:MonocleGiraffe,代码行数:9,代码来源:ImageUserControl.xaml.cs

示例3: UiElementOnHolding

 private void UiElementOnHolding(object sender, HoldingRoutedEventArgs e)
 {
     if (e.HoldingState == HoldingState.Completed && uiElement != null)
     {
         var position = e.GetPosition(uiElement);
         ShowMenu(position);
         e.Handled = true;
         isPointerPressed = false;
         uiElement.CancelDirectManipulations();
     }
 }
开发者ID:Opiumtm,项目名称:DvachBrowser3,代码行数:11,代码来源:PopupLogicHelper.cs

示例4: OnHolding

        public override void OnHolding(HoldingRoutedEventArgs e)
        {
            base.OnHolding(e);
            if (e.HoldingState == HoldingState.Started)
            {
                Point2D point = Map.ScreenToMap(e.GetPosition(Map));

                if (_points == null || _points.Count < 1)
                {
                    //当点的个数小余一个时,不能结束。
                    return;
                }
                else
                {
                    DrawPoint(point, false);
                    Complete();
                }
            }
        }
开发者ID:SuperMap,项目名称:iClient-WP8-Example,代码行数:19,代码来源:CustomClientMeasure.xaml.cs

示例5: ContentRoot_Holding

 /// <summary>
 /// Fired when the image is press and held
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ContentRoot_Holding(object sender, HoldingRoutedEventArgs e)
 {
     FrameworkElement element = sender as FrameworkElement;
     if (element != null)
     {
         Point p = e.GetPosition(element);
         flyoutMenu.ShowAt(element, p);
     }
 }
开发者ID:eugeniopacceli,项目名称:Baconit,代码行数:14,代码来源:BasicImageContentPanel.xaml.cs

示例6: OnHolding

        protected override void OnHolding(HoldingRoutedEventArgs e)
        {
            // Responding to HoldingState.Started will show a context menu while your finger is still down, while 
            // HoldingState.Completed will wait until the user has removed their finger. 
            if (e.HoldingState == Windows.UI.Input.HoldingState.Completed)
            {
                var PointerPosition = e.GetPosition(null);

                var MyObject = (e.OriginalSource as FrameworkElement).DataContext as SampleDataModel;
                ShowContextMenu(MyObject, null, PointerPosition);
                e.Handled = true;

                // This, combined with a check in OnRightTapped prevents the firing of RightTapped from
                // launching another context menu
                _IsPointerPressed = false;

                // This prevents any scrollviewers from continuing to pan once the context menu is displayed.  
                // Ideally, you should find the ListViewItem itself and only CancelDirectMinpulations on that item.  
                var ItemsToCancel = VisualTreeHelper.FindElementsInHostCoordinates(PointerPosition, ItemListView);
                foreach (var Item in ItemsToCancel)
                {
                    var Result = Item.CancelDirectManipulations();
                }
            }

            base.OnHolding(e);
        }
开发者ID:hirokuma3,项目名称:Windows-universal-samples,代码行数:27,代码来源:Scenario1.xaml.cs

示例7: OnHolding

        /// <summary>
        /// ${ui_action_DrawLine_event_OnHolding_D}
        /// </summary>
        public override void OnHolding(HoldingRoutedEventArgs e)
        {
            base.OnHolding(e);
            if (e.HoldingState == HoldingState.Started)
            {
                Point2D item = Map.ScreenToMap(e.GetPosition(Map));

                if (_points == null || _points.Count < 1)
                    return;

                else
                {
                    while (_points.Count > _pointsCount)
                    {
                        _points.RemoveAt(_points.Count - 1);
                    }
                    _points.Add(item);
                    _pointsCount++;
                }
                endDraw(false);
            }
        }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:25,代码来源:DrawLine.cs

示例8: DataGrid_Holding

        private void DataGrid_Holding(object sender, HoldingRoutedEventArgs e)
        {
            if (e.PointerDeviceType != PointerDeviceType.Mouse)
            {
                if (e.HoldingState == HoldingState.Started)
                {
                    var pt = e.GetPosition(_cellPanel);
                    int row = GetRowFromPoint(pt);
                    _cellPanel.HandlePointerPressed(row);
                }
                //Completed when pointer release

                //Canceled when pointer move
                else
                {
                    _cellPanel.ClearPointerPressedAnimation();
                }

            }
        }
开发者ID:GJian,项目名称:UWP-master,代码行数:20,代码来源:DataGridTouchMethods.cs

示例9: TouchPanel_Holding

        void TouchPanel_Holding(object sender, HoldingRoutedEventArgs e)
        {
            // prevent twice holding
            if (e.HoldingState == Windows.UI.Input.HoldingState.Completed)
                return;


            Geopoint point;
            MapCtrl.GetLocationFromOffset(e.GetPosition(MapCtrl), out point);

            LastSearchGeopoint = new Geopoint(new BasicGeoposition() { Latitude = point.Position.Latitude, Longitude = point.Position.Longitude });

            ShowSearchLocationPoint(LastSearchGeopoint, string.Empty);

            //MapCtrl.TrySetViewAsync(LastSearchGeopoint,null,null,null,MapAnimationKind.None);

            //ReverseGeocode(true);
        }
开发者ID:ThePublicBikeGang,项目名称:EasyBike,代码行数:18,代码来源:MainPage.xaml.cs

示例10: TranslationItemHolding

 private void TranslationItemHolding(object sender, HoldingRoutedEventArgs e)
 {
     if (!_isShowingContextMenu)
     {
         _isShowingContextMenu = true;
         TranslationItemHoldingOrRightTapped(sender, e.GetPosition(null), e.OriginalSource);
     }
 }
开发者ID:hubaishan,项目名称:quran-phone,代码行数:8,代码来源:DetailsView.xaml.cs

示例11: ImageHolding

 private async void ImageHolding(object sender, HoldingRoutedEventArgs e)
 {
     if (!_isShowingContextMenu)
     {
         _isShowingContextMenu = true;
         await ImageHoldingOrRightTapped(sender, (ui) => { return e.GetPosition(ui); });
     }
 }
开发者ID:hubaishan,项目名称:quran-phone,代码行数:8,代码来源:DetailsView.xaml.cs

示例12: Canvas_Holding_1

        private void Canvas_Holding_1(object sender, HoldingRoutedEventArgs e)
        {
            //Allow drawing
            var thisCanvas = sender as Canvas;
            thisCanvas.CancelDirectManipulations();
            Point ptPos = e.GetPosition(thisCanvas);
            ptPos.Y -= 40;
            ptPos.X += 40;

            flashText.SetValue(Canvas.LeftProperty, ptPos.X);
            flashText.SetValue(Canvas.TopProperty, ptPos.Y);
            flashText.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }
开发者ID:mbin,项目名称:Win81App,代码行数:13,代码来源:Scenario4.xaml.cs

示例13: OnHolding

        /// <summary>
        /// ${ui_action_DrawPolygon_event_OnHolding_D}
        /// </summary>
        public override void OnHolding(HoldingRoutedEventArgs e)
        {
            base.OnHolding(e);
            if (e.HoldingState == HoldingState.Started)
            {
                //如果只画了小于或等于两个点的话,就不执行完成事件。
                if (_points == null || _points.Count < 2)
                    return;

                while (_points.Count > _pointsCount)
                {
                    _points.RemoveAt(_points.Count - 2);
                }
                Point2D item = Map.ScreenToMap(e.GetPosition(Map));
                _points.Insert(_points.Count - 1, item);
                _pointsCount++;
                endDraw(false);
            }
        }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:22,代码来源:DrawPolygon.cs

示例14: MyMap_Holding

 void MyMap_Holding(object sender, HoldingRoutedEventArgs e)
 {
     if (!AddPointPopup.IsOpen && !drawingPointerIsOn) { AddPointPopup.IsOpen = true; 
     pressedLocation = myMap.ViewportPointToLocation(e.GetPosition(myMap));
     }
     else
     {
         MapGrid.CancelDirectManipulations();
     }
               
     
 }
开发者ID:rvrtex,项目名称:mJohnsonYouMaps,代码行数:12,代码来源:MapPage.xaml.cs


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