/// <summary> /// Destruct and cleanup the view hierarchy of the header group. /// </summary> public void Destruct() { // Remove paint delegate so we can be garbage collected _buttonManager.NeedPaint = null; // Cleanup the button manager events and processing _buttonManager.Destruct(); // Remove the old root from the canvas _viewGroup.Dispose(); _viewGroup.Clear(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { // Remove any showing tooltip OnCancelToolTip(this, EventArgs.Empty); // Remember to pull down the manager instance _buttonManager.Destruct(); } base.Dispose(disposing); }