protected override void Dispose(bool disposing)
{
if (disposing)
{
if (_ribbonColorButton != null)
{
// Must unhook to prevent memory leaks
_ribbonColorButton.PropertyChanged -= new PropertyChangedEventHandler(OnButtonPropertyChanged);
// Remove association with definition
_ribbonColorButton.ColorButtonView = null;
_ribbonColorButton = null;
}
}
base.Dispose(disposing);
}