/// <summary>
        /// Refresh the gesture recognizer
        /// </summary>
        /// <param name="enabledGestures">The enabled gestures</param>
        private void RefreshGestureRecognizer(SpatialGestures enabledGestures)
        {
            this.UnsubscribeGestureEvents();

            bool ok = this.gestureRecognizer.TrySetGestureSettings((SpatialGestureSettings)enabledGestures);

            if (!ok)
            {
                this.gestureRecognizer.CancelPendingGestures();
                this.gestureRecognizer.TrySetGestureSettings((SpatialGestureSettings)enabledGestures);
            }

            // Tap events
            if ((enabledGestures & (SpatialGestures.Tap | SpatialGestures.DoubleTap)) != 0)
            {
                this.gestureRecognizer.Tapped += this.OnGestureTapped;
            }

            // Hold events
            if (enabledGestures.HasFlag(SpatialGestures.Hold))
            {
                this.gestureRecognizer.HoldCanceled  += this.OnGestureHoldCanceled;
                this.gestureRecognizer.HoldCompleted += this.OnGestureHoldCompleted;
                this.gestureRecognizer.HoldStarted   += this.OnGestureHoldStarted;
            }

            // manipulation events
            if (enabledGestures.HasFlag(SpatialGestures.ManipulationTranslate))
            {
                this.gestureRecognizer.ManipulationCanceled  += this.OnGestureManipulationCanceled;
                this.gestureRecognizer.ManipulationCompleted += this.OnGestureManipulationCompleted;
                this.gestureRecognizer.ManipulationStarted   += this.OnGestureManipulationStarted;
                this.gestureRecognizer.ManipulationUpdated   += this.OnGestureManipulationUpdated;
            }

            // navigation events
            if ((enabledGestures & (SpatialGestures.NavigationX
                                    | SpatialGestures.NavigationY
                                    | SpatialGestures.NavigationZ
                                    | SpatialGestures.NavigationRailsX
                                    | SpatialGestures.NavigationRailsY
                                    | SpatialGestures.NavigationRailsZ)) != 0)
            {
                this.gestureRecognizer.NavigationCanceled  += this.OnGestureNavigationCanceled;
                this.gestureRecognizer.NavigationCompleted += this.OnGestureNavigationCompleted;
                this.gestureRecognizer.NavigationStarted   += this.OnGestureNavigationStarted;
                this.gestureRecognizer.NavigationUpdated   += this.OnGestureNavigationUpdated;
            }

            // Gesture recognition events
            if (enabledGestures != SpatialGestures.None)
            {
                this.gestureRecognizer.RecognitionEnded   += this.OnGestureRecognitionEnded;
                this.gestureRecognizer.RecognitionStarted += this.OnGestureRecognitionStarted;
            }
        }
        /// <summary>
        /// The default values
        /// </summary>
        protected override void DefaultValues()
        {
            base.DefaultValues();

#if UWP
            this.spatialInputManager = new SpatialInputManager(this);
#endif

            this.enabledGestures = SpatialGestures.None;
        }