private void GestureListener_Flick(object sender, Microsoft.Phone.Controls.FlickGestureEventArgs e)
        {
            if (e.HorizontalVelocity < 0)
            {
                // Load the next
                if (dateControlFlick.Month != DateTime.Now.Month || dateControlFlick.Year != DateTime.Now.Year)
                {
                    rigthMoveStoryboard.Begin();
                    //fadeInOut.Begin();
                    //upStoryboard.Begin();
                    dateControlFlick = dateControlFlick.AddMonths(1);
                    InitializeAllComponents();
                    PrepareComponentesParaMesesPassados();
                    //StartTransitionRigthFadeIn();
                }
            }

            // User flicked towards right
            if (e.HorizontalVelocity > 0)
            {
                // Load the previous
                leftMoveStoryboard.Begin();
                //fadeInOut.Begin();
                //downStoryboard.Begin();
                dateControlFlick = dateControlFlick.AddMonths(-1);
                InitializeAllComponents();
                PrepareComponentesParaMesesPassados();
                //StartTransitionLeftFadeIn();
            }
        }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            try
            {
                if (!myImage.IsOrigin)
                    return;

                // User swap towards gauche
                if (e.HorizontalVelocity > 0)
                {
                    // Load the next image
                    ViewModel.SelectedPictureIndex -= 1;
                }

                // User swap towards droit
                if (e.HorizontalVelocity < 0)
                {
                    // Load the previous image
                    ViewModel.SelectedPictureIndex += 1;
                }

                myImage.Picture = ViewModel.SelectedPicture;
            }
            catch (Exception)
            {

            }
        }
 void OnFlick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         int change = e.HorizontalVelocity > 0 ? -1 : 1;
         Times.SelectedIndex = (Times.SelectedIndex + change) % Times.Items.Count;
         e.Handled = true;
     }
 }
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.VerticalVelocity < 0)
     {
         MessageBox.Show("Nach oben geschnippst");
     }
     else
     {
         MessageBox.Show("Nach unten geschnippst");
     }
 }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if(e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                if(e.HorizontalVelocity < -800 && HasNext)
                {
                    ++_currentMessage;
                    ShowMessage();
                }

                if (e.HorizontalVelocity > 800 && HasPrev)
                {
                    --_currentMessage;
                    ShowMessage();
                }
            }
        }
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            DoubleAnimation da = new DoubleAnimation();
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                da.From = gridTransform.X;
                // flick right
                if (e.HorizontalVelocity < 0 && (currentPosition == TablePosition.FirstQuadrant || currentPosition == TablePosition.ThirdQuadrant))
                {
                    da.To = gridTransform.X - ContentPanel.Width/2;
                    if (currentPosition == TablePosition.FirstQuadrant)
                    {
                        currentPosition = TablePosition.SecondQuadrant;
                    }
                    else
                    {
                        currentPosition = TablePosition.FourthQuadrant;
                    }
                }
                // flick left
                else if (e.HorizontalVelocity > 0 && (currentPosition == TablePosition.SecondQuadrant || currentPosition == TablePosition.FourthQuadrant))
                {
                    da.To = gridTransform.X + ContentPanel.Width/2;
                    if (currentPosition == TablePosition.SecondQuadrant)
                    {
                        currentPosition = TablePosition.FirstQuadrant;
                    }
                    else
                    {
                        currentPosition = TablePosition.ThirdQuadrant;
                    }
                }
                Storyboard.SetTargetProperty(da, new PropertyPath(TranslateTransform.XProperty));
            }
            da.Duration = new Duration(TimeSpan.FromMilliseconds(250));
            Storyboard.SetTarget(da, gridTransform);

            Storyboard sb1 = new Storyboard();
            if (da.To != null)
            {
                sb1.Children.Add(da);
                sb1.Begin();
            }
        }
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction == Orientation.Horizontal)
            {
                LearningGameViewModel learningGameViewModel = DataContext as LearningGameViewModel;

                if ((e.Angle > 180 - AngleThreshold) && (e.Angle < 180 + AngleThreshold))
                {
                    VisualStateManager.GoToState(this, Normal.Name, false);
                    VisualStateManager.GoToState(this, AdvanceLeft.Name, false);
                    learningGameViewModel.NextCommand.Execute(null);
                    e.Handled = true;
                }
                else if ((e.Angle < 0 + AngleThreshold) || (e.Angle > 360 - AngleThreshold))
                {
                    VisualStateManager.GoToState(this, Normal.Name, false);
                    VisualStateManager.GoToState(this, AdvanceRight.Name, false);
                    learningGameViewModel.PreviousCommand.Execute(null);
                    e.Handled = true;
                }
            }
        }
Beispiel #8
0
        private void onFlick(object sender, FlickGestureEventArgs e)
        {
            var viewModel = DataContext as VerseListViewModel;
            if (viewModel == null)
                return;

            if (Math.Abs(e.HorizontalVelocity) < Math.Abs(e.VerticalVelocity))
                return;

            if (e.HorizontalVelocity < 0.0)
            {
                if (viewModel.SelectedVerseIndex >= viewModel.Verses.Count - 1)
                    viewModel.SelectedVerseIndex = 0;
                else
                    viewModel.SelectedVerseIndex++;
            }
            else if (e.HorizontalVelocity > 0.0)
            {
                if (viewModel.SelectedVerseIndex <= 0)
                    viewModel.SelectedVerseIndex = viewModel.Verses.Count - 1;
                else
                    viewModel.SelectedVerseIndex--;
            }
        }
 private void OnFlick(object sender, FlickGestureEventArgs e)
 {
     NavigationService.Navigate(new Uri("/FireDetails.xaml?location=" + location + "&season=" + season + "&year=" + year, UriKind.Relative));
 }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.VerticalVelocity > FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date = Date.AddMonths(1);
                CurrentDay = Date;
            }

            if (e.VerticalVelocity < -FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date = Date.AddMonths(-1);
                CurrentDay = Date;
            }
        }
        private void listener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction != Orientation.Vertical)
            {
                return;
            }

            _stopTimer.Tick -= _stopTimer_Tick;
            double vMax = MaximumFlickVelocity;

            _lastFlickVelocity = Math.Min(vMax, Math.Max(e.VerticalVelocity, -vMax));

            Point velocity = new Point(0, _lastFlickVelocity);
            double flickDuration = PhysicsConstants.GetStopTime(velocity);
            Point flickEndPoint = PhysicsConstants.GetStopPoint(velocity);
            IEasingFunction flickEase = PhysicsConstants.GetEasingFunction(flickDuration);

            AnimatePanel(new Duration(TimeSpan.FromSeconds(flickDuration)), flickEase, _panningTransform.Y + flickEndPoint.Y);

            IsFlicking = true;
            _firstDragDuringFlick = true;
            _scrollingTowards = -1; 
            e.Handled = true;
        }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
#if false
            if (ViewModelLocator.MainStatic.ImagePopupOpened)
                return;

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal
                && e.Angle > 160 && e.Angle < 200)
                (this.DataContext as ReadArticleViewModel).the_article.ReadThisArticleComment.Execute(null);
            else if (e.Direction == System.Windows.Controls.Orientation.Horizontal
                && (e.Angle > 350 || e.Angle < 40)
                && NavigationService.CanGoBack)
                NavigationService.GoBack();
#endif
        }
 private void OnHeaderFlick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Vertical)
     {
         // User flicked towards top
         if (e.VerticalVelocity < 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedUp, "MapToggle");
         }
         // User flicked towards bottom
         else if (e.VerticalVelocity > 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedDown, "MapToggle");
         }
     }
 }
 private void ContentPanel_GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Angle > 135 && e.Angle < 225)         // to right 
     {
         MoveToNextWord(sender, null);
     }
     else if (e.Angle > 315 || e.Angle < 45)     // to left 
     {
         MoveToPrevWord(sender, null);
     } 
 }
Beispiel #15
0
        public void RowCounterGestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if(e.Direction == System.Windows.Controls.Orientation.Vertical)
            {
                // Determine if this was meant to increment (up) or decrement (down)
                bool isIncrement = e.VerticalVelocity < 0;

                Point location = e.GetPosition(this.RowCounterControl.RowCounterColor);
                if(location.X >= (this.RowCounterControl.RowCounterColor.RenderTransformOrigin.X + (this.RowCounterControl.RowCounterColor.RenderSize.Width / 2)))
                {
                    IncrementRow(isIncrement ? 1 : -1);
                }
                else
                {
                    if(this.IsTensDigitEnabled)
                    {
                        IncrementRow(isIncrement ? 10 : -10);
                    }
                }
            }
        }
 public void myGridGestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     FlipViewUtility.FlickHandler(sender, e, DataContext as ViewModelBase, this);
 }
Beispiel #17
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            StackPanel p = sender as StackPanel;
            Log.Info("xxx", e.VerticalVelocity.ToString());
            Log.Info("xxx", e.HorizontalVelocity.ToString());
            Log.Info("xxx", e.Angle.ToString());
            Log.Info("xxx", e.Direction.ToString());
            Log.Info("xxx", e.GetPosition(p).X.ToString());
            Log.Info("xxx", e.GetPosition(p).X.ToString());

            if (PopupWindow.IsShown)
            {
                return;
            }

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                StackPanel parent = sender as StackPanel;
                if (parent == null)
                {
                    Log.Error(TAG, "GestureListener_Flick, parent is null.");
                    return;
                }
                ToDoItem item = parent.DataContext as ToDoItem;
                if (item != null)
                {
                    if (e.HorizontalVelocity > 1000 && Math.Abs(e.VerticalVelocity) < 300)//flick to right
                    {
                        this.SetItemCompleted(parent, item);
                    }
                    else if (e.HorizontalVelocity < 0)//flick to left
                    {
                        this.SetItemUnCompleted(parent, item);
                    }
                }
            }
        }
Beispiel #18
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction.ToString() == "Horizontal")
            {
                if (e.HorizontalVelocity > 0)
                {
                    switch (pantalla)
                    {
                        case 2:
                            AnimacionDosDerecha.Begin();
                            pantalla--;
                            break;
                        case 3:
                            AnimacionTresDerecha.Begin();
                            pantalla--;
                            break;
                        case 4:
                            AnimacionCuatroDerecha.Begin();
                            pantalla--;
                            break;
                    }
                }
                else
                {
                    switch (pantalla)
                    {
                        case 1:
                            AnimacionUno.Begin();
                            pantalla++;
                            break;
                        case 2:
                            AnimacionDosIzquierda.Begin();
                            pantalla++;
                            break;
                        case 3:
                            AnimacionTresIzquierda.Begin();
                            pantalla++;
                            break;
                    }

                }
            }
        }
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            UserFlick = true;
            if (e.HorizontalVelocity > 0)
            {
                var CurrentImg = Images.First(i => i.Item2.IsOnTop);
                var preImage = Images[Images.IndexOf(CurrentImg) - 1];

                while (!(Math.Abs(preImage.Item2.ImageShift) < 1))
                {
                    if (preImage.Item2.ImageShift > 0)
                    {
                        Images.ToList().ForEach(i => i.Item2.ImageShift--);
                    }
                    if (preImage.Item2.ImageShift < 0)
                    {
                        Images.ToList().ForEach(i => i.Item2.ImageShift++);
                    }
                    Images.ToList().ForEach(i => i.Item1.RefreshSettings(i.Item2));
                }
            }
            if (e.HorizontalVelocity < 0)
            {
                var CurrentImg = Images.First(i => i.Item2.IsOnTop);
                var nextImage = Images[Images.IndexOf(CurrentImg) - 1];

                while (!(Math.Abs(nextImage.Item2.ImageShift) < 1))
                {
                    if (nextImage.Item2.ImageShift > 0)
                    {
                        Images.ToList().ForEach(i => i.Item2.ImageShift--);
                    }
                    if (nextImage.Item2.ImageShift < 0)
                    {
                        Images.ToList().ForEach(i => i.Item2.ImageShift++);
                    }
                    Images.ToList().ForEach(i => i.Item1.RefreshSettings(i.Item2));
                }
            }
        }
 private void OnFlick(object sender, FlickGestureEventArgs e)
 {
     // navigate to SpellingResultsPage.xaml if no animals are left
     if (animalSpelling.NextAnimal(userInputTextBox.Text) == null)
         NavigationService.Navigate(new Uri("/AnimalMath;component/AnimalView/SpellingResultsPage.xaml", UriKind.Relative));
     else
         DisplayCurrentAnimal();
 }
Beispiel #21
0
        //when you flick the screen, you can make it do something here
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            if (e.HorizontalVelocity < 0) // determine direction (Right > 0)
            {
                //Some Action
                refreshPage();      //reset the page to new images and #'s
            }
            else
            {
                //Some Action
                refreshPage();      //reset the page to new images and #'s
            }

        }
Beispiel #22
0
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            //refreshPage();

            if (e.HorizontalVelocity < 0) // determine direction (Right > 0)
            {
                //Some Action
                refreshPage();
            }
            else
            {
                //Some Action
                refreshPage();
            }

        }
Beispiel #23
0
 private void ListenerFlick(object sender, FlickGestureEventArgs e)
 {
     Invoke(e);
 }
Beispiel #24
0
        private void vwOverlay_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction != System.Windows.Controls.Orientation.Vertical)
                return;

            if (e.VerticalVelocity >= 0)
                return;

            e.Handled = true;
            vwOverlay.Visibility = Visibility.Collapsed;
        }
Beispiel #25
0
 private void GestureListener_OnFlick(object sender, FlickGestureEventArgs e)
 {
     if (UseAccelerometer || LoadPopup.IsOpen || SavePopup.IsOpen || HelpPopup.IsOpen
         || MusicPopup.IsOpen || ChatPopup.IsOpen) return;
     if (Math.Abs(e.HorizontalVelocity - 0) > 0.001 &&
         e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         if (e.GetPosition(LayoutRoot).Y < 400)
         {
             ShakeHead();
         }
         else
         {
             MoveFoot();
         }
     }
     if (Math.Abs(e.VerticalVelocity - 0) > 0.001 &&
         e.Direction == System.Windows.Controls.Orientation.Vertical)
     {
         BowHead();
     }
 }
 private void OnFlickBottom(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         // User flicked towards left
         if (e.HorizontalVelocity < 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedLeft, "BottomList");
         }
         // User flicked towards right
         else if (e.HorizontalVelocity > 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedRight, "BottomList");
         }
     }
     else if (e.Direction == System.Windows.Controls.Orientation.Vertical)
     {
         // User flicked towards top
         if (e.VerticalVelocity < 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedUp, "BottomList");
         }
         // User flicked towards bottom
         else if (e.VerticalVelocity > 0)
         {
             FlickMessage.Send(DrumbleApp.Shared.Messages.Enums.FlickMessageReason.FlickedDown, "BottomList");
         }
     }
 }
 private void gesture_Flick(object sender, FlickGestureEventArgs e)
 {
     flickMessage.Text = string.Format("flick angle {0} in the {1} direction and velocity ({2},{3}) ",
         (int)e.Angle, e.Direction, e.HorizontalVelocity, e.VerticalVelocity);
 }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            //ignore if direction is not horizontal
            if (e.Direction != System.Windows.Controls.Orientation.Horizontal)
                return;

            //right-to-left
            if (e.HorizontalVelocity < 0)
            {
                //MessageBox.Show("right to left");
                string uriString = "/Page2.xaml";
                //String uriString = "Uri=/iPhone_Skin;component/Page2.xaml";
                NavigationService.Navigate(
                new Uri(uriString, UriKind.RelativeOrAbsolute));

            }

            //left-to-right
            if (e.HorizontalVelocity > 0)
            {
                //MessageBox.Show("left to right");
                string uriString = "/Page3.xaml";
                //String uriString = "Uri=/iPhone_Skin;component/Page3.xaml";
                NavigationService.Navigate(
                new Uri(uriString, UriKind.RelativeOrAbsolute));
            }
        }
 private void GestureListener_OnFlick(object sender, FlickGestureEventArgs e)
 {
     IfNotFirstSetp();
 }
 private void OnFlick(object sender, FlickGestureEventArgs e)
 {
     flickData.Text = string.Format("{0} Flick: Angle {1} Velocity {2},{3}",
         e.Direction, Math.Round(e.Angle), e.HorizontalVelocity, e.VerticalVelocity);
 }
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
#if false
            if (ViewModelLocator.MainStatic.ImagePopupOpened)
                return;

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal
                && (e.Angle > 350 || e.Angle < 40)
                && NavigationService.CanGoBack)
                NavigationService.GoBack();
#endif
        }