示例#1
0
        /// <summary>
        /// Initializes a new instance of the RefreshLayout class.
        /// </summary>
        /// <param name="parent"></param>
        public RefreshLayout(EvasObject parent) : base(parent)
        {
            MinimumHeight  = _minimumSize;
            _refreshState  = RefreshState.Idle;
            _refreshIcon   = new RefreshIcon(parent);
            _contentLayout = new Box(parent);
            _refreshIcon.Show();
            _contentLayout.Show();

            _gestureLayer = new GestureLayer(parent);
            _gestureLayer.Attach(_contentLayout);
            _gestureLayer.SetMomentumCallback(GestureLayer.GestureState.Move, OnMoved);
            _gestureLayer.SetMomentumCallback(GestureLayer.GestureState.End, OnEnded);
            _gestureLayer.SetMomentumCallback(GestureLayer.GestureState.Abort, OnEnded);

            this.PackEnd(_contentLayout);
            this.PackEnd(_refreshIcon);

            SetLayoutCallback(OnLayoutUpdate);
        }