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