예제 #1
0
        public Scroller(UiView view, Mode mode, ScrollingService scrollingService)
        {
            _mode    = mode;
            _view    = view;
            _service = scrollingService;

            if (mode.HasFlag(Mode.BothDrag))
            {
                view.EnabledGestures = (GestureType.FreeDrag | GestureType.Down | GestureType.Up);
            }
            else if (mode.HasFlag(Mode.VerticalDrag))
            {
                view.EnabledGestures = (GestureType.VerticalDrag | GestureType.Down | GestureType.Up);
            }
            else if (mode.HasFlag(Mode.HorizontalDrag))
            {
                view.EnabledGestures = (GestureType.HorizontalDrag | GestureType.Down | GestureType.Up);
            }

            if (mode.HasFlag(Mode.HorizontalWheel) || mode.HasFlag(Mode.VerticalWheel))
            {
                view.EnabledGestures   |= (GestureType.MouseWheel);
                _wheelScrollsHorizontal = mode.HasFlag(Mode.HorizontalWheel);
            }
        }
예제 #2
0
        protected override void OnAdded()
        {
            _scrollingService = new ScrollingService(this, _rule);
            _scroller         = new Scroller(this, _mode, _scrollingService, _wheelSpeed);

            base.OnAdded();
        }
예제 #3
0
파일: UiListBox.cs 프로젝트: prepare/Sitana
        protected override void OnAdded()
        {
            Scroller.Mode mode = (_vertical ? Scroller.Mode.VerticalDrag | Scroller.Mode.VerticalWheel : Scroller.Mode.HorizontalDrag | Scroller.Mode.HorizontalWheel);

            _scrollingService = new ScrollingService(this, _rule, _maxScrollExceed);
            _scroller         = new Scroller(this, mode, _scrollingService, _wheelSpeed);

            base.OnAdded();
        }
예제 #4
0
 public Scroller(UiView view, Mode mode, ScrollingService scrollingService, float wheelSpeed)
     : this(view, mode, scrollingService)
 {
     _wheelSpeed = wheelSpeed;
 }