Пример #1
0
        protected override IBound LayoutChildren(IStyleSheet stylesheet, IBound styleBound, IBound maxBound)
        {
            float[] borders;
            IBound  bound = ControlsContext.Current.CreateLayoutBehaviour(stylesheet, this)
                            .Vertical(ContainerBehaviour.Childrens, styleBound, maxBound, out borders, true);

            if (ContainerBehaviour.Childrens.Count > 0)
            {
                Behavour.SetBorders(borders);
            }

            Behavour.ScrollingArea = bound.Height;
            return(bound);
        }
Пример #2
0
        protected override void View_TouchInvoke(object sender, View.TouchEventArgs e)
        {
            base.View_TouchInvoke(sender, e);

            if (Scrolled)
            {
                if (e.Event.Action == MotionEventActions.Up ||
                    e.Event.Action == MotionEventActions.Cancel)
                {
                    float offset = Behavour.HandleSwipe(_startY, e.Event.GetY(), _view.ScrollY);
                    Scroll(offset);
                    Scrolled         = false;
                    ScrollPerGesture = 0;
                    e.Handled        = true;
                }
            }
        }