public virtual void SetBackground(string imagePath, ContentStretch stretch) { BackgroundHexCode = null; Backer = new ImageControl { Size = Size.ToSize(), Stretch = stretch, }; Backer.Loaded += (o, ev) => Redraw(); Backer.FilePath = imagePath; }
protected override void Dispose(bool disposing) { if (CellBitmap != null) { var bit = CellBitmap; Bitmaps.Remove(this); mem -= bit.Width * bit.Height * 4; bit.Dispose(); } if (Backer != null) { Backer.Dispose(); Backer = null; } base.Dispose(disposing); }