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)
            {
            }
        }
Ejemplo n.º 2
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (gEdit.Visibility == System.Windows.Visibility.Visible)
            {
                return;
            }
            ImageDetails item = null;

            if (e.HorizontalVelocity < 0)
            {
                if (_index + 1 == _contextItems.Count)
                {
                    return;
                }
                _index++;
                //load next
                item = _contextItems[_index];
            }
            else if (e.HorizontalVelocity > 0)
            {
                if (_index == 0)
                {
                    return;
                }
                //load previous
                _index--;
                item = _contextItems[_index];
            }
            _context    = new ItemViewModel(item);
            DataContext = _context;
            if (!_context.IsDataLoaded)
            {
                _context.LoadData();
            }
        }
Ejemplo n.º 3
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            var uri1 = "/imgs/justicia-ciudadana-postal01.jpg";
            var uri2 = "/imgs/Justicia-Ciudadana-postal02.jpg";
            var uri3 = "/imgs/justicia-ciudadana-postal03.jpg";


            string currURI = "";

            switch (currIndexFlick)
            {
            case 0:
                currURI = uri2;
                currIndexFlick++;
                break;

            case 1:
                currURI = uri3;
                currIndexFlick++;
                break;

            case 2:
                currURI        = uri1;
                currIndexFlick = 0;
                break;
            }

            imgCurrent.Source = new BitmapImage(new Uri(currURI, UriKind.Relative));
        }
Ejemplo n.º 4
0
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            //string.Format("{0} Flick: Angle {1} Velocity {2},{3}",
            //    e.Direction, Math.Round(e.Angle), e.HorizontalVelocity, e.VerticalVelocity);
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                if (e.HorizontalVelocity < 0)
                {
                    GetNextImage();
                }
                else if (e.HorizontalVelocity > 0)
                {
                    GetLastImage();
                }
            }
            else if (e.Direction == System.Windows.Controls.Orientation.Vertical)
            {
                if (e.VerticalVelocity > 0)
                {
                    GetNextImage();
                }
                else if (e.VerticalVelocity < 0)
                {
                    GetLastImage();
                }
            }

            // Collapse PageTitle
            PageTitleCollapse();
        }
Ejemplo n.º 5
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction.ToString() == "Horizontal") //Left or right
     {
         if (e.HorizontalVelocity > 0)           // Right
         {
             Debug.WriteLine("Left");
             if (_isSettingsOpen)
             {
                 VisualStateManager.GoToState(this, "OpeningSettings", true);
                 _isSettingsOpen = false;
             }
         }
         else //Left
         {
             // Add code for Left swipe handling
             Debug.WriteLine("Right");
             if (!_isSettingsOpen)
             {
                 VisualStateManager.GoToState(this, "ClosingSettings", true);
                 _isSettingsOpen = true;
             }
         }
     }
 }
Ejemplo n.º 6
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     try
     {
         if (e.HorizontalVelocity < 0)
         {
             ink1.Visibility = Visibility.Collapsed;
             if (ink1.Visibility == Visibility.Collapsed)
             {
                 webBrowser1.Margin = new Thickness(-7, -92, 0, 0);
                 webBrowser1.Height = 669;
             }
         }
         if (e.HorizontalVelocity > 0)
         {
             ink1.Visibility    = Visibility.Visible;
             webBrowser1.Margin = new Thickness(-7, -35, 0, 0);
             webBrowser1.Height = 606;
             if (ink1.Visibility == Visibility.Collapsed)
             {
                 webBrowser1.Margin = new Thickness(-7, -92, 0, 0);
                 webBrowser1.Height = 669;
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 7
0
 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");
         }
     }
 }
Ejemplo n.º 8
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();
     }
 }
        void listener_Flick(object sender, FlickGestureEventArgs e)
        {
            //Debug.WriteLine("listener_Flick");

            if (e.Direction == Orientation.Vertical)
            {
                _state = State.Flicking;

                _selectedItem = null;
                if (!IsExpanded)
                {
                    IsExpanded = true;
                }

                Point           velocity      = new Point(0, e.VerticalVelocity);
                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);

                e.Handled = true;

                _selectedItem = null;
                UpdateItemState();
            }
        }
        private void GestureListener_OnFlick(object sender, FlickGestureEventArgs e)
        {
            if (PanAndZoom == null)
            {
                return;
            }
            if (PanAndZoom.CurrentScaleX != 1.0)
            {
                return;
            }

            if (e.HorizontalVelocity > 0 && (e.Angle > 330 || e.Angle < 30))
            {
                if (ViewModel.CanSlideRight)
                {
                    var storyboard = (Storyboard)Resources["SlideRightAnimation"];
                    storyboard.Begin();
                }
            }
            else if (e.HorizontalVelocity < 0 && (e.Angle > 150 && e.Angle < 210))
            {
                if (ViewModel.CanSlideLeft)
                {
                    var storyboard = (Storyboard)Resources["SlideLeftAnimation"];
                    storyboard.Begin();
                }
            }

            e.Handled = true;
        }
        private void GestureListener_OnFlick(object sender, FlickGestureEventArgs e)
        {
            DebugTextBlock.Text = string.Format("Flick HVelocity={0} Angel={1}", e.HorizontalVelocity, e.Angle);
            if (PanAndZoom.CurrentScaleX != 1.0)
            {
                return;
            }

            if (e.HorizontalVelocity > 0 && (e.Angle > 330 || e.Angle < 30))
            {
                if (ViewModel.CanSlideRight)
                {
                    var storyboard = (Storyboard)Resources["SlideRightAnimation"];
                    storyboard.Begin();
                }
            }
            else if (e.HorizontalVelocity < 0 && (e.Angle > 150 && e.Angle < 210))
            {
                if (ViewModel.CanSlideLeft)
                {
                    var storyboard = (Storyboard)Resources["SlideLeftAnimation"];
                    storyboard.Begin();
                }
            }
            e.Handled = true;
            return;
        }
Ejemplo n.º 12
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalVelocity < 0)
     {
         string tmp = LocalFileCache.ContentEncoder(orgUrl);
         NavigationService.Navigate(new Uri("/Views/NotePage.xaml?url=" + tmp, UriKind.Relative));
     }
 }
Ejemplo n.º 13
0
 private void GestureListener_OnFlick(object sender, FlickGestureEventArgs e)
 {
     if (e.HorizontalVelocity > 0)
     {
     }
     else
     {
     }
 }
Ejemplo n.º 14
0
        protected virtual void RaiseFlick(FlickGestureEventArgs e)
        {
            var handler = Flick;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 15
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.VerticalVelocity < 0)
     {
         MessageBox.Show("Nach oben geschnippst");
     }
     else
     {
         MessageBox.Show("Nach unten geschnippst");
     }
 }
Ejemplo n.º 16
0
 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();
     }
 }
Ejemplo n.º 17
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (QuickButtonShowed)
     {
         HideQuickButton();
     }
     else
     {
         ShowQuickButton();
     }
     QuickButtonShowed = !QuickButtonShowed;
 }
Ejemplo n.º 18
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
     }
 }
Ejemplo n.º 19
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == Orientation.Horizontal)
     {
         if (e.HorizontalVelocity < 0)     // determine direction (Right > 0)
         {
             //Some Action
         }
         else
         {
             //Some Action
         }
     }
 }
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            double hAb  = Math.Abs(e.HorizontalVelocity);
            double hVer = Math.Abs(e.VerticalVelocity);

            if (hAb > hVer && e.HorizontalVelocity < 500)
            {
                _vm.LaterCommand.Execute(null);
            }
            else if (hAb > hVer && e.HorizontalVelocity > 500)
            {
                _vm.EerderCommand.Execute(null);
            }
        }
        public static void Flick(object sender, FlickGestureEventArgs e)
        {
            FrameworkElement fe     = sender as FrameworkElement;
            double           offset = fe.GetHorizontalOffset().Value;

            if (e.HorizontalVelocity < -FlickVelocity)
            {
                MenuOpen(fe);
            }
            else if (e.HorizontalVelocity > FlickVelocity)
            {
                MenuBounceBack(fe);
            }
        }
Ejemplo n.º 22
0
 //Gesture - Flick
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction.ToString().Equals("Horizontal"))
     {
         if (e.HorizontalVelocity > 0)//right
         {
             NavigationService.Navigate(new Uri("/More.xaml", UriKind.Relative));
         }
         else //Left
         {
             NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
         }
     }
 }
Ejemplo n.º 23
0
        // Flick Gesture code
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction.ToString().Equals("Horizontal"))
            {
                if (e.HorizontalVelocity > 0)                                              // right
                {
                    NavigationService.Navigate(new Uri("/AddNew.xaml", UriKind.Relative)); //Navigate to AddNew.xaml
                }
                else  //Left

                {
                    NavigationService.Navigate(new Uri("/More.xaml", UriKind.Relative));//Navigate to More.xaml where Favourite place is displayed
                }
            }
        }
Ejemplo n.º 24
0
        private void OnFlick(object sender, FlickGestureEventArgs e)
        {
            //refreshPage();

            if (e.HorizontalVelocity < 0) // determine direction (Right > 0)
            {
                //Some Action
                refreshPage();
            }
            else
            {
                //Some Action
                refreshPage();
            }
        }
Ejemplo n.º 25
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;
        }
Ejemplo n.º 26
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalVelocity > 0)
     {
         if (App.RootFrame.CanGoBack)
         {
             App.RootFrame.GoBack();
         }
         else
         {
             string tmp = LocalFileCache.ContentEncoder(url);
             NavigationService.Navigate(new Uri("/Views/BrowserPage.xaml?url=" + tmp, UriKind.Relative));
         }
     }
 }
Ejemplo n.º 27
0
        private void CardInfo_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                int currentIndex = Cards.AllCards.IndexOf(this.DataContext as Card);
                int nextIndex    = e.HorizontalVelocity < 0 ? currentIndex + 1 : currentIndex - 1;

                if (nextIndex < 0 || nextIndex >= Cards.AllCards.Count)
                {
                    return;
                }

                var nextCard = Cards.AllCards[nextIndex];
                this.DataContext = nextCard;
            }
        }
Ejemplo n.º 28
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         if (e.HorizontalVelocity < 0)
         {
             index++;
             loadImage();
         }
         if (e.HorizontalVelocity > 0)
         {
             index--;
             loadImage();
         }
     }
 }
Ejemplo n.º 29
0
        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;
            }
        }
Ejemplo n.º 30
0
 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");
         }
     }
 }
        void listener_Flick(object sender, FlickGestureEventArgs e)
        {
            //Debug.WriteLine("listener_Flick");

            if (e.Direction == Orientation.Horizontal)
            {
                _state = State.Flicking;

                _selectedItem = null;
                if (!IsExpanded)
                {
                    IsExpanded = true;
                }

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

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

                e.Handled = true;

                _selectedItem = null;
                UpdateItemState();
            }
        }