protected void OnGridSizeChanged(EventArgs args) { GridSizeChanged?.Invoke(this, args); this.cellWidth = width / colsAmount; this.cellHeight = height / rowsAmount; bitmap?.Dispose(); bitmap = new Bitmap(width, height); graphics?.Dispose(); graphics = Graphics.FromImage(bitmap); }
/// <summary> /// Raises the <see cref="GridSizeChanged"/> event. /// </summary> /// <param name="e"> /// An <see cref="EventArgs"/> that contains the event data. /// </param> protected virtual void OnGridSizeChanged(EventArgs e) { GridSizeChanged?.Invoke(this, e); }
internal void RaiseGridSizeChanged() { Frame = new CGRect(0, 0, Width, Height); GridSizeChanged?.Invoke(IntrinsicContentSize); }