Ejemplo n.º 1
0
 private void OnGesture(GestureBehavior sender, Gesture gesture)
 {
     if (this.manipulationBehavior != null)
     {
         this.manipulationBehavior.HandleGesture(gesture);
     }
 }
        /// <summary>
        /// Determines whether all the condinitions, needed to process a gesture, are met.
        /// </summary>
        /// <param name="gesture">The gesture to examine.</param>
        /// <returns></returns>
        protected virtual bool CanHandleGesture(Gesture gesture)
        {
            if (!this.IsEnabled)
            {
                return(false);
            }

            if (this.Panel.WaitingForLayout)
            {
                return(false);
            }

            if (gesture.GestureType == KnownGesture.Flick)
            {
                DragDirection flickDirection = GestureBehavior.GetDragDirection((gesture as FlickGesture).Velocity);
                if (this.View.Orientation == Orientation.Horizontal)
                {
                    return(flickDirection == DragDirection.Horizontal);
                }

                return(flickDirection == DragDirection.Vertical);
            }

            return(gesture.GestureType == KnownGesture.Pan);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RadSlideView"/> class.
        /// </summary>
        public SlideView()
        {
            this.DefaultStyleKey = typeof(SlideView);
            this.SizeChanged    += this.OnSizeChanged;

            this.behavior = new GestureBehavior(this);
            this.behavior.NotifyGesture         = this.OnGesture;
            this.behavior.NotifyGestureStart    = this.OnGestureStarted;
            this.behavior.NotifyGestureComplete = this.OnGestureCompleted;

            this.slideShowTimer       = new DispatcherTimer();
            this.slideShowTimer.Tick += this.OnSlideShowTimerTick;
        }