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


C# Input.ManipulationCompletedEventArgs類代碼示例

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


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

示例1: CenterGrid_ManipulateCompleted

        private void CenterGrid_ManipulateCompleted(object sender, ManipulationCompletedEventArgs manipulationCompletedEventArgs)
        {
            double deltaX = TouchDownX - manipulationCompletedEventArgs.ManipulationOrigin.X;
            double deltaY = TouchDownY - manipulationCompletedEventArgs.ManipulationOrigin.Y;

            double absX = Math.Abs(TouchDownX - manipulationCompletedEventArgs.ManipulationOrigin.X);
            double absY = Math.Abs(TouchDownY - manipulationCompletedEventArgs.ManipulationOrigin.Y);

            if (absX > absY) //left or right
            {
                if (deltaX > 0 & deltaX > 12) //right
                {
                    ((StudyFlashCardSetViewModel)ViewModel).FlipCardRightCommand.Execute(null);
                }
                else if (deltaX < -12) //left
                {
                    ((StudyFlashCardSetViewModel)ViewModel).FlipCardLeftCommand.Execute(null);
                }
            }
            else // up or down
            {
                if (deltaY > 0 & deltaY > 12) //up
                {
                    ((StudyFlashCardSetViewModel)ViewModel).CorrectNextCardCommand.Execute(null);
                }
                else if (deltaY < -12) //down
                {
                    ((StudyFlashCardSetViewModel)ViewModel).IncorrectNextCardCommand.Execute(null);
                }
            }
        }
開發者ID:j-hayes,項目名稱:Flash-Card-App,代碼行數:31,代碼來源:StudyFlashCardSetView.xaml.cs

示例2: CalendarButton_ManipulationCompleted

        private void CalendarButton_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            SolidColorBrush brush = new SolidColorBrush();
            brush.Color = (Color)App.Current.Resources["CalendarBackNormalGray"];

            CalendarButton.Background = brush;
        }
開發者ID:richardaum,項目名稱:Metroist-for-Windows-Phone,代碼行數:7,代碼來源:AddTask.xaml.cs

示例3: azul_ManipulationCompleted_1

 private void azul_ManipulationCompleted_1(object sender, ManipulationCompletedEventArgs e)
 {
     Ellipse elipse = sender as Ellipse;
     string nombreObjeto = (sender as Ellipse).Name;
     bool entroAnterior=false;
     if (elipse.Name == "negro" || elipse.Name == "blanco" || elipse.Name == "amarillo" || elipse.Name=="verde")
     {
         if ((e.TotalManipulation.Translation.Y * -1) > 127 && (e.TotalManipulation.Translation.Y * -1) < 380)
         {
            entroAnterior= CambiarColores(nombreObjeto);
         }
    }
     else
     {
         if ((e.TotalManipulation.Translation.Y * -1) > 312 && (e.TotalManipulation.Translation.Y * -1) < 560)
         {
           entroAnterior= CambiarColores(nombreObjeto);
         }
     }
     if (!entroAnterior)
     {
         nombreAnterior = (sender as Ellipse).Name;
     }
     elipse.RenderTransform = null;
    
 }
開發者ID:jacevedo,項目名稱:Windows-Phone,代碼行數:26,代碼來源:MainPage.xaml.cs

示例4: OnManipulationCompleted

        protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
        {
            base.OnManipulationCompleted(e);

            if(BlockTransitions) return;

            var horizontalVelocity = e.FinalVelocities.LinearVelocity.X;
            var verticalVelocity = e.FinalVelocities.LinearVelocity.Y;

            var direction = GetDirection(horizontalVelocity, verticalVelocity);

            if (direction == Orientation.Horizontal && Math.Abs(horizontalVelocity) > 200)
            {
                if (e.TotalManipulation.Translation.X < 0)
                {
                    if (ShowNextButton)
                        SlideLeft.Begin();
                    else
                        SlideTopLeft.Begin();
                }
                else
                {
                    if (ShowPreviousButton)
                        SlideRight.Begin();
                    else
                        SlideTopRight.Begin();
                }
            }
        }
開發者ID:Belenar,項目名稱:OtherAppRepository,代碼行數:29,代碼來源:FlipControl.xaml.cs

示例5: CalendarManipulationCompleted

        void CalendarManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            while (TouchPanel.IsGestureAvailable)
            {
                var gesture = TouchPanel.ReadGesture();
                if (gesture.GestureType == GestureType.Flick)
                {
                    double horizontal = gesture.Delta.X / Factor;
                    double vertical = gesture.Delta.Y / Factor;
                    if (Math.Abs(horizontal) > Math.Abs(vertical))
                    {
                        if ((int)horizontal > 0)
                        {
                            DecrementMonth();
                        }
                        else
                        {
                            IncrementMonth();
                        }
                    }
                    else
                    {
                        if ((int)vertical > 0)
                        {
                            DecrementYear();
                        }
                        else
                        {
                            IncrementYear();

                        }
                    }
                }
            }
        }
開發者ID:AndrzejRPiotrowski,項目名稱:Startups,代碼行數:35,代碼來源:Calendar.cs

示例6: btn_Camera_ManipulationCompleted

 private void btn_Camera_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
 {
     PhotoChooserTask pcTask = new PhotoChooserTask();
     pcTask.ShowCamera = true;
     pcTask.Completed += new EventHandler<PhotoResult>(pcTask_Completed);
     pcTask.Show();
 }
開發者ID:GhostSoar,項目名稱:JigsawPuzzle,代碼行數:7,代碼來源:CameraOrPhotosLibrary.xaml.cs

示例7: OnManipulationCompleted

 protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
 {
     string dest = "/page2.xaml";
     canvy.Children.Remove(jolidessin);
     this.NavigationService.Navigate(new Uri(dest, UriKind.Relative));
     base.OnManipulationCompleted(e);
 }
開發者ID:gabrielhan,項目名稱:Wphone,代碼行數:7,代碼來源:Page1.xaml.cs

示例8: azul_ManipulationCompleted_1

        // Al soltar el circulo. Comprueba coordenadas.
        private void azul_ManipulationCompleted_1(object sender, ManipulationCompletedEventArgs e)
        {
            Ellipse elipse = sender as Ellipse;
            string nombreObjeto = (sender as Ellipse).Name;
            double elipsex = Canvas.GetLeft(rect) + e.TotalManipulation.Translation.X;
            double elipsey = Canvas.GetTop(rect) + e.TotalManipulation.Translation.Y;
            //Canvas.Left="130" Canvas.Top="138"  Width="187"
            if (elipse.Name == "rojo" || elipse.Name == "azul" || elipse.Name == "amarillo")
            {
                if ((elipsex * -1) > 130 && (elipsex * -1) < 317)
                {
                    CambiarColores(nombreObjeto, nombreAnterior);
                }
            }
                //??
            else
            {
                if ((e.TotalManipulation.Translation.Y * -1) > 312 && (e.TotalManipulation.Translation.Y * -1) < 560)
                {
                    CambiarColores(nombreObjeto, nombreAnterior);
                }
            }

            if (ver == 0)
            {
                nombreAnterior = (sender as Ellipse).Name;
            }
            elipse.RenderTransform = null;
            dragTranslation = new CompositeTransform();
        }
開發者ID:jacevedo,項目名稱:Windows-Phone,代碼行數:31,代碼來源:MainPage.xaml.cs

示例9: OnManipulationCompleted

        protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
        {
            if (e.TotalManipulation.Translation.X == 0.0 && e.TotalManipulation.Translation.Y == 0.0)
                HandleMouseEvent(e.ManipulationOrigin);

            base.OnManipulationCompleted(e);
        }
開發者ID:michaellperry,項目名稱:MyCon,代碼行數:7,代碼來源:RatingControl.xaml.cs

示例10: Slider1ManipulationCompleted

 private void Slider1ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
 {
     var totalminutes = (int)slider1.Value;
     _hours = totalminutes / 60;
     _minutes = totalminutes - (60 * _hours);
     inpDuration.Value = new TimeSpan(_hours, _minutes, 0);
 }
開發者ID:mmadsen42,項目名稱:ThumbReg-for-TimeLog-Project,代碼行數:7,代碼來源:AddRegistrationPage.xaml.cs

示例11: Element_ManipulationCompleted

        private void Element_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            if (!IsActive)
            return;

              FrameworkElement fe = sender as FrameworkElement;
              if (Math.Abs(e.TotalManipulation.Translation.X) > fe.ActualWidth / 2 ||
            Math.Abs(e.FinalVelocities.LinearVelocity.X) > FlickVelocity)
              {
            if (e.TotalManipulation.Translation.X < 0.0)
            {
              ToDoItemDeletedAction(fe);
            }
            else
            {
              ToDoItemCompletedAction(fe);
            }
              }
              else
              {
            ToDoItemBounceBack(fe);
              }

              IsActive = false;
        }
開發者ID:andersberglund,項目名稱:WP7-ClearStyle,代碼行數:25,代碼來源:SwipeInteraction.cs

示例12: OnManipulationCompleted

        protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
        {
            FrameworkElement _root = Application.Current.RootVisual
               as FrameworkElement;
            myDate = (DateTime)_root.DataContext;

            // swipe to the right (100 pixels to the right
            // and -25 to 25 up or down in the translation)
            // change to nextday
            if (e.TotalManipulation.Translation.X > 100 &&
                (e.TotalManipulation.Translation.Y > -25 &&
                 e.TotalManipulation.Translation.Y < 25))
            {
                _root.DataContext = myDate.AddDays(-1);

                NavigationService.Navigate(new Uri("/Page/DayEvent.xaml?Refresh=" + DateTime.Now, UriKind.Relative));
            }

            // swipe to the left (100 pixels to the left
            // and -25 to 25 up or down in the translation)
            // change to previous day
            if (e.TotalManipulation.Translation.X < -100 &&
                (e.TotalManipulation.Translation.Y > -25 &&
                 e.TotalManipulation.Translation.Y < 25))
            {
                _root.DataContext = myDate.AddDays(1);

                NavigationService.Navigate(new Uri("/Page/DayEvent.xaml?Refresh=" + DateTime.Now, UriKind.Relative));
            }
        }
開發者ID:pokpatrick,項目名稱:PhoneApp,代碼行數:30,代碼來源:DayEvent.xaml.cs

示例13: FrontImage_ManipulationCompleted

        void FrontImage_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            App app = (App)Application.Current;

            if (canBeChanged && app.canPlay)
            {
                Stream stream = TitleContainer.OpenStream("sounds/flip/" + RandomNumber(1, 10) + ".wav");
                SoundEffect effect = SoundEffect.FromStream(stream);
                FrameworkDispatcher.Update();
                effect.Play();
                app.manager.setNextCard(this);
            }
            
            /*
            if (e.OriginalSource == this.FrontImage)
            {
                Console.Write("foo");
                this.FrontImage.Visibility = Visibility.Collapsed;
                this.BackImage.Visibility = Visibility.Visible;
            }
            else if (e.OriginalSource == this.BackImage)
            {
                Console.Write("foo");
                this.BackImage.Visibility = Visibility.Collapsed;
                this.FrontImage.Visibility = Visibility.Visible;
            }*/
            
        }
開發者ID:tobiasheine,項目名稱:EyeemMemory,代碼行數:28,代碼來源:EyeemMemoryCard.xaml.cs

示例14: Border_ManipulationCompleted

 private void Border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
 {
     // suppress zoom
     if (e.FinalVelocities.ExpansionVelocity.X != 0.0 ||
         e.FinalVelocities.ExpansionVelocity.Y != 0.0)
         e.Handled = true;
 }
開發者ID:timextreasures,項目名稱:WordPress-WindowsPhone,代碼行數:7,代碼來源:LicensesPage.xaml.cs

示例15: canvas_ManipulationCompleted

        private void canvas_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            var left = Canvas.GetLeft(LayoutRoot);
            if (_viewMoved)
                return;
            if (Math.Abs(initialPosition - left) < 100)
            {
                //bouncing back
                MoveViewWindow(initialPosition);
                return;
            }
            //change of state
            if (initialPosition - left > 0)
            {
                //slide to the left
                if (initialPosition > -420)
                    MoveViewWindow(-420);
                else
                    MoveViewWindow(-840);
            }
            else
            {
                //slide to the right
                if (initialPosition < -420)
                    MoveViewWindow(-420);
                else
                    MoveViewWindow(0);
            }

        }
開發者ID:angelroic,項目名稱:Upreal,代碼行數:30,代碼來源:MyList.xaml.cs


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