Пример #1
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                if (Control.IsAlive())
                {
                    Control.SetOnClickListener(null);
                    Control.SetOnTouchListener(null);
                    Control.RemoveOnAttachStateChangeListener(this);
                }

                _backgroundTracker?.Dispose();
                _backgroundTracker     = null;
                _visualElementRenderer = null;
            }

            base.Dispose(disposing);
        }
Пример #2
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                _backgroundTracker?.Dispose();
                _backgroundTracker     = null;
                _visualElementRenderer = null;
            }

            base.Dispose(disposing);
        }
Пример #3
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                SetOnClickListener(null);
                SetOnTouchListener(null);
                OnFocusChangeListener = null;
                SetOnCheckedChangeListener(null);

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

                _automationPropertiesProvider?.Dispose();
                _tracker?.Dispose();
                _visualElementRenderer?.Dispose();
                _backgroundTracker?.Dispose();
                _backgroundTracker = null;

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

            base.Dispose(disposing);
        }