當前位置: 首頁>>代碼示例>>C#>>正文


C# Input.ManipulationDeltaRoutedEventArgs類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ManipulationDeltaRoutedEventArgs類的具體用法?C# ManipulationDeltaRoutedEventArgs怎麽用?C# ManipulationDeltaRoutedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ManipulationDeltaRoutedEventArgs類屬於Windows.UI.Xaml.Input命名空間,在下文中一共展示了ManipulationDeltaRoutedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnManipulationDelta

        private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (_panel.ItemsFitContent)
            {
                return;
            }

            double deltaX = e.Delta.Translation.X;

            if (e.IsInertial)
            {
                e.Complete();
            }
            else
            {
                if (Math.Abs(e.Cumulative.Translation.X) >= this.ItemWidthEx)
                {
                    e.Complete();
                }
                else
                {
                    _headerContainer.TranslateDeltaX(deltaX);
                    _panelContainer.TranslateDeltaX(deltaX);
                    if (Math.Sign(deltaX) > 0)
                    {
                        _tabsContainer.TranslateDeltaX(deltaX * _tabs.PrevTabWidth / this.ItemWidthEx);
                    }
                    else
                    {
                        _tabsContainer.TranslateDeltaX(deltaX * _tabs.SelectedTabWidth / this.ItemWidthEx);
                    }
                }
            }
            e.Handled = true;
        }
開發者ID:ridomin,項目名稱:waslibs,代碼行數:35,代碼來源:Pivorama.Manipulation.cs

示例2: DeltaImageManipulation

 private void DeltaImageManipulation(object sender, ManipulationDeltaRoutedEventArgs e)
 {
     Image block = (Image)sender;
     _thickness.Left = block.Margin.Left + e.Delta.Translation.X;
     _thickness.Top = block.Margin.Top + e.Delta.Translation.Y;
     block.Margin = _thickness;
 }
開發者ID:housemeow,項目名稱:OurSecrets,代碼行數:7,代碼來源:MainPage.xaml.cs

示例3: if

        private void rect觸控測試區_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            Debug.WriteLine("ManipulationDelta");

            if (e.Cumulative.Translation.X > 150)
            {
                Refresh手勢操作結果("向右滑動");
                e.Handled = true;
            }
            else if (e.Cumulative.Translation.X < -150)
            {
                Refresh手勢操作結果("向左滑動");
                e.Handled = true;
            }
            else if (e.Cumulative.Translation.Y > 150)
            {
                Refresh手勢操作結果("向下滑動");
                e.Handled = true;
            }
            else if (e.Cumulative.Translation.Y < -150)
            {
                Refresh手勢操作結果("向上滑動");
                e.Handled = true;
            }
        }
開發者ID:vulcanlee,項目名稱:Windows8Lab,代碼行數:25,代碼來源:MainPage.xaml.cs

示例4: theCanvas_ManipulationDelta

        private void theCanvas_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (isInInertion)
              {
            return;
              }
              var top = Canvas.GetTop(this.rect);
              var left = Canvas.GetLeft(this.rect);

              top += e.Delta.Translation.Y;
              left += e.Delta.Translation.X;

              var scale = e.Delta.Scale;

              //var oldWidth = this.rect.Width;
              //var oldHeight = this.rect.Height;

              //this.rect.Width *= scale;
              //this.rect.Height *= scale;

              //top -= (this.rect.Height - oldHeight) / 2;
              //left -= (this.rect.Width - oldWidth) / 2;

              Canvas.SetTop(this.rect, top);
              Canvas.SetLeft(this.rect, left);

              var transform = this.rect.RenderTransform as CompositeTransform;
              //transform.ScaleX += e.Delta.Scale / 100;
              //transform.ScaleY += e.Delta.Scale / 100;

              transform.CenterX = this.rect.Width / 2;
              transform.CenterY = this.rect.Height / 2;
              transform.Rotation += e.Delta.Rotation;
              //transform.Angle += e.Delta.Rotation;
        }
開發者ID:TelerikAcademy,項目名稱:Windows-Applications,代碼行數:35,代碼來源:MainPage.xaml.cs

示例5: CaptureOnManipulationDelta

        private void CaptureOnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs args)
        {
            //Not inertia
            if (args.IsInertial)
            {
                return;
            }

            var zoom = ViewModel.Zoom;
            if (zoom != null && zoom.Supported)
            {
                double max = args.Cumulative.Translation.Y;

                double halfHeight = Window.Current.Bounds.Height / 8;

                double delta = - (max / halfHeight);

                float value = currentZoom + Convert.ToInt32(delta) * 0.5f;

                if (value >= zoom.Min && value <= zoom.Max)
                {
                    zoom.Value = value;
                }

            }
        }
開發者ID:Ontropix,項目名稱:slow-camera,代碼行數:26,代碼來源:VideoRecorderView.xaml.cs

示例6: OnManipulationDelta

 private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
 {
     if (e.PointerDeviceType != PointerDeviceType.Mouse)
     {
         TransformMap(e.Position, e.Delta.Translation, e.Delta.Rotation, e.Delta.Scale);
     }
 }
開發者ID:bhanu475,項目名稱:XamlMapControl,代碼行數:7,代碼來源:Map.WinRT.cs

示例7: ItemLayer_ManipulationDelta

        private void ItemLayer_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (e.Cumulative.Translation.X != 0.0)
            {
                Grid itemlayer = (Grid)sender;
                var transform = (CompositeTransform)itemlayer.RenderTransform;
                User user = ((FrameworkElement)e.OriginalSource).DataContext as User;

                if (user == null) return;

                // Reveals Call
                if (e.Cumulative.Translation.X < -16 && Math.Abs(e.Cumulative.Translation.X) <= 128)
                {

                    transform.TranslateX = e.Cumulative.Translation.X;
                }



                // Reveals Email
                if (e.Cumulative.Translation.X > 16 && e.Cumulative.Translation.X <= 128)
                {

                    transform.TranslateX = e.Cumulative.Translation.X;
                }


                e.Handled = true;
            }
            else
            {
                e.Handled = false;
            }
        }
開發者ID:thomasrunner,項目名稱:SlackUsersList_Windows,代碼行數:34,代碼來源:UsersListView.xaml.cs

示例8: OnManipulationDelta

 private void OnManipulationDelta(object Sender, ManipulationDeltaRoutedEventArgs DeltaRoutedEventArgs)
 {
     if (DeltaRoutedEventArgs.IsInertial)
     {
         if (_manipulationStartPoint.X - DeltaRoutedEventArgs.Position.X > 200)
         {
             _gameGrid.HandleMove(MoveDirection.Left);
             DeltaRoutedEventArgs.Complete();
             DeltaRoutedEventArgs.Handled = true;
         }
         else if (DeltaRoutedEventArgs.Position.X - _manipulationStartPoint.X > 200)
         {
             _gameGrid.HandleMove(MoveDirection.Right);
             DeltaRoutedEventArgs.Complete();
             DeltaRoutedEventArgs.Handled = true;
         }
         else if (_manipulationStartPoint.Y - DeltaRoutedEventArgs.Position.Y > 200)
         {
             _gameGrid.HandleMove(MoveDirection.Up);
             DeltaRoutedEventArgs.Complete();
             DeltaRoutedEventArgs.Handled = true;
         }
         else if (DeltaRoutedEventArgs.Position.Y - _manipulationStartPoint.Y > 200)
         {
             _gameGrid.HandleMove(MoveDirection.Down);
             DeltaRoutedEventArgs.Complete();
             DeltaRoutedEventArgs.Handled = true;
         }
     }
 }
開發者ID:andrecurvello,項目名稱:2048,代碼行數:30,代碼來源:MainPage.xaml.cs

示例9: OnPageManipulationDelta

        private void OnPageManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            var delta = e.Delta;
            var translationDelta = delta.Translation;

            this.ViewModel.MovePlayer(translationDelta.Y);
        }
開發者ID:luiseduardohdbackup,項目名稱:Windows-Universal,代碼行數:7,代碼來源:MainPage.xaml.cs

示例10: circlePanel_ManipulationDelta

        private void circlePanel_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            rotateTransform.CenterX = circlePanel.X;
            rotateTransform.CenterY = circlePanel.Y;

            storyboard.Begin();
            e.Complete();
        }
開發者ID:x01673,項目名稱:BCMeng_Project,代碼行數:8,代碼來源:wheel.xaml.cs

示例11: Grid_ManipulationDelta

 private void Grid_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
 {
     k.Rotate(-e.Delta.Rotation/180.0 * Math.PI);
     k.Translate(e.Delta.Translation);
     if(e.Delta.Scale>0)
         k.Scale(e.Delta.Scale);
     G.Background = new SolidColorBrush(Colors.AliceBlue);
 }
開發者ID:MohammedAbuissa,項目名稱:KarakibLab,代碼行數:8,代碼來源:Gesture.xaml.cs

示例12: RightHandle_ManipulationDelta

 private void RightHandle_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
 {
     var t = (sender as Grid).RenderTransform as CompositeTransform;
     var x = (LeftHandle.RenderTransform as CompositeTransform).TranslateX;
     var f = x + this.Size * .5;
     var c = this.Range;
     t.TranslateX = Translate(t, e, f, c);
     RightHandleText.Text = Text(t.TranslateX);
 }
開發者ID:noriike,項目名稱:xaml-106136,代碼行數:9,代碼來源:MainPage.xaml.cs

示例13: Ellipse_ManipulationDelta

 private void Ellipse_ManipulationDelta(object sender,
     ManipulationDeltaRoutedEventArgs e)
 {
     var elli = sender as Ellipse;
     var delta = e.Delta;
     this.ScaleEllipse(elli, delta);
     this.RotateEllipse(elli, delta);
     this.TranslateEllipse(elli, delta);
 }
開發者ID:luiseduardohdbackup,項目名稱:Windows-Universal,代碼行數:9,代碼來源:MainPage.xaml.cs

示例14: Translate

 private double Translate(CompositeTransform s, ManipulationDeltaRoutedEventArgs e, double floor, double ceiling)
 {
     var target = s.TranslateX + e.Delta.Translation.X;
     if (target < floor)
         return floor;
     if (target > ceiling)
         return ceiling;
     return target;
 }
開發者ID:noriike,項目名稱:xaml-106136,代碼行數:9,代碼來源:MainPage.xaml.cs

示例15: OnAdornManipulationDelta

 private async void OnAdornManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
 {
     double delta = e.Delta.Translation.Y;
     await TranslateDelta(delta);
     if (_cancelManipulation)
     {
         e.Complete();
     }
 }
開發者ID:ridomin,項目名稱:waslibs,代碼行數:9,代碼來源:HtmlViewer.Gestures.cs


注:本文中的Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。