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); } }
protected override void OnAdded() { _scrollingService = new ScrollingService(this, _rule); _scroller = new Scroller(this, _mode, _scrollingService, _wheelSpeed); base.OnAdded(); }
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(); }
public Scroller(UiView view, Mode mode, ScrollingService scrollingService, float wheelSpeed) : this(view, mode, scrollingService) { _wheelSpeed = wheelSpeed; }