Esempio n. 1
0
        void ClearLayoutListener()
        {
            if (_carouselViewLayoutListener == null)
            {
                return;
            }

            ViewTreeObserver?.RemoveOnGlobalLayoutListener(_carouselViewLayoutListener);
            _carouselViewLayoutListener.LayoutReady -= LayoutReady;
            _carouselViewLayoutListener              = null;
        }
Esempio n. 2
0
        void AddLayoutListener()
        {
            if (_carouselViewLayoutListener != null)
            {
                return;
            }

            _carouselViewLayoutListener              = new CarouselViewwOnGlobalLayoutListener();
            _carouselViewLayoutListener.LayoutReady += LayoutReady;

            ViewTreeObserver.AddOnGlobalLayoutListener(_carouselViewLayoutListener);
        }