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

            _disposed = true;

            if (disposing)
            {
                _automationPropertiesProvider?.Dispose();
                Tracker?.Dispose();

                if (Element != null)
                {
                    TearDownOldElement(Element as ItemsView);

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

            base.Dispose(disposing);
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #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 (Platform.GetRenderer(Element) == this)
                    {
                        Element.ClearValue(Platform.RendererProperty);
                    }
                }
            }

            base.Dispose(disposing);
        }