Beispiel #1
0
        private IEnumerator <int> NormalState()
        {
            TryRunAnimation("Normal");
            while (true)
            {
#if WIN || MAC
                if (IsMouseOverThisOrDescendant())
                {
                    SetState(HoveredState());
                }
#else
                if (clickGesture.WasBegan())
                {
                    SetState(PressedState());
                }
#endif
                yield return(0);
            }
        }
Beispiel #2
0
        void Advance()
        {
            if (Thumb == null)
            {
                return;
            }
            var draggingJustBegun = false;

            if (GloballyEnabled && RangeMax > RangeMin)
            {
                if (dragGestureThumb.WasRecognized())
                {
                    activeDragGesture = dragGestureThumb;
                    TryStartDrag();
                    draggingJustBegun = true;
                }
                else
                {
                    if (clickGesture.WasBegan())
                    {
                        TryStartDrag();
                        SetValueFromCurrentMousePosition(false);
                    }
                    if (clickGesture.WasRecognizedOrCanceled() && !dragGestureSlider.WasRecognized())
                    {
                        TryEndDrag();
                    }
                    if (dragGestureSlider.WasRecognized())
                    {
                        activeDragGesture = dragGestureSlider;
                        TryStartDrag();
                        dragInitialDelta  = 0;
                        dragInitialOffset = (Value - RangeMin) / (RangeMax - RangeMin);
                        draggingJustBegun = false;
                    }
                }
            }
            if (activeDragGesture?.WasEnded() ?? false)
            {
                TryEndDrag();
            }
            if (Enabled && (activeDragGesture?.IsChanging() ?? false))
            {
                SetValueFromCurrentMousePosition(draggingJustBegun);
            }
            InterpolateGraphicsBetweenMinAndMaxMarkers();
            RefreshThumbPosition();
        }