Exemplo n.º 1
0
        GenItemClass GetCancelEffectTemplete()
        {
            if (_cancelEffectTemplete != null)
            {
                return(_cancelEffectTemplete);
            }
            _cancelEffectTemplete = new GenItemClass("full_off")
            {
                GetContentHandler = (data, part) =>
                {
                    VisualElement element  = data as VisualElement;
                    var           renderer = Platform.GetOrCreateRenderer(element);

                    if (element.MinimumHeightRequest == -1)
                    {
                        SizeRequest request = element.Measure(double.PositiveInfinity, double.PositiveInfinity);
                        renderer.NativeView.MinimumHeight = XForms.ConvertToScaledPixel(request.Request.Height);
                    }
                    else
                    {
                        renderer.NativeView.MinimumHeight = XForms.ConvertToScaledPixel(element.MinimumHeightRequest);
                    }
                    (renderer as LayoutRenderer)?.RegisterOnLayoutUpdated();

                    return(renderer.NativeView);
                }
            };

            return(_cancelEffectTemplete);
        }
        void UpdateContentSize()
        {
            _scrollCanvas.MinimumWidth  = XForms.ConvertToScaledPixel(Element.ContentSize.Width + Element.Padding.HorizontalThickness);
            _scrollCanvas.MinimumHeight = XForms.ConvertToScaledPixel(Element.ContentSize.Height + Element.Padding.VerticalThickness);

            Device.BeginInvokeOnMainThread(() =>
            {
                if (Control != null)
                {
                    OnScrolled(Control, EventArgs.Empty);
                }
            });
        }