Example #1
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                SetOnClickListener(null);
                SetOnTouchListener(null);
                RemoveOnAttachStateChangeListener(this);

                _automationPropertiesProvider?.Dispose();
                _tracker?.Dispose();

                _backgroundTracker?.Dispose();

                if (Element != null)
                {
                    Element.PropertyChanged -= OnElementPropertyChanged;

                    if (Platform.GetRenderer(Element) == this)
                    {
                        Element.ClearValue(Platform.RendererProperty);
                    }
                }
            }

            base.Dispose(disposing);
        }
        void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                if (Element != null)
                {
                    Element.PropertyChanged -= OnElementPropertyChanged;
                }

                if (_renderer != null)
                {
                    _renderer.ElementChanged         -= OnElementChanged;
                    _renderer.ElementPropertyChanged -= OnElementPropertyChanged;
                    _renderer = null;
                }

                _gestureManager?.Dispose();
                _automationPropertiesProvider?.Dispose();
            }
        }
        void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                EffectUtilities.UnregisterEffectControlProvider(this, Element);

                if (Element != null)
                {
                    Element.PropertyChanged -= OnElementPropertyChanged;
                }

                if (_renderer != null)
                {
                    _renderer.ElementChanged         -= OnElementChanged;
                    _renderer.ElementPropertyChanged -= OnElementPropertyChanged;
                    _renderer = null;
                }

                _gestureManager?.Dispose();
                _automationPropertiesProvider?.Dispose();
            }
        }
Example #4
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                SetOnClickListener(null);
                SetOnTouchListener(null);
                RemoveOnAttachStateChangeListener(this);

                _automationPropertiesProvider?.Dispose();
                _tracker?.Dispose();

                if (Element != null)
                {
                    Element.PropertyChanged -= OnElementPropertyChanged;
                }
            }

            base.Dispose(disposing);
        }