Exemplo n.º 1
0
 public void DestroyResources()
 {
     if (_brush != null)
     {
         _brush.Dispose();
         _brush = null;
     }
 }
        /// <summary>
        /// Disposes the resources used by the GeometrySurface
        /// </summary>
        public void Dispose()
        {
            _surface?.Dispose();
            _geometry?.Dispose();
            if (_generator != null)
            {
                _generator.DeviceReplaced -= OnDeviceReplaced;
            }
            _stroke.Brush.Dispose();
            _fill.Dispose();
            _backgroundBrush.Dispose();

            _stroke          = null;
            _fill            = null;
            _backgroundBrush = null;
            _surface         = null;
            _generator       = null;
            _geometry        = null;
        }