private void OnEnabled(object sender, EventArgs e)
{
if ((_ribbonGallery != null) && (_ribbonGallery.Ribbon != null))
{
PropertyDescriptor propertyEnabled = TypeDescriptor.GetProperties(_ribbonGallery)["Enabled"];
bool oldValue = (bool)propertyEnabled.GetValue(_ribbonGallery);
bool newValue = !oldValue;
_changeService.OnComponentChanged(_ribbonGallery, null, oldValue, newValue);
propertyEnabled.SetValue(_ribbonGallery, newValue);
}
}