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

            _disposed = true;

            if (!disposing)
            {
                return;
            }

            _defaultShape = null;
            if (_shapeManager != null)
            {
                _shapeManager.Dispose();
                _shapeManager = null;
            }

            SetVisualElement(_visualElement, null);

            if (_renderer == null)
            {
                return;
            }
            _renderer.ElementChanged -= OnRendererElementChanged;

            _context    = null;
            _nativeView = null;
            _renderer   = null;
        }
Beispiel #2
0
        public MaterialBackgroundManager(IVisualElementRenderer renderer)
        {
            _renderer = renderer ?? throw new ArgumentNullException(nameof(renderer), "Renderer cannot be null");
            _renderer.ElementChanged += OnRendererElementChanged;

            _defaultShape = new RoundRect();
            _shapeManager = new MaterialShapeManager();

            SetVisualElement(null, _renderer.Element);
        }