|
|
|
@ -88,15 +88,16 @@ namespace ICSharpCode.WpfDesign.AddIn |
|
|
|
object[] attributes = item.ComponentType.GetCustomAttributes(typeof(DefaultEventAttribute), true); |
|
|
|
object[] attributes = item.ComponentType.GetCustomAttributes(typeof(DefaultEventAttribute), true); |
|
|
|
if (attributes.Length == 1) { |
|
|
|
if (attributes.Length == 1) { |
|
|
|
DefaultEventAttribute dae = (DefaultEventAttribute)attributes[0]; |
|
|
|
DefaultEventAttribute dae = (DefaultEventAttribute)attributes[0]; |
|
|
|
// To filter controls derived from ItemsControl
|
|
|
|
var events = TypeDescriptor.GetEvents(item.Component); |
|
|
|
if (dae.Name != "OnItemsChanged") |
|
|
|
var eventInfo = events[dae.Name]; |
|
|
|
{ |
|
|
|
if(eventInfo != null) |
|
|
|
DesignItemProperty property = item.Properties.GetProperty(dae.Name); |
|
|
|
{ |
|
|
|
if (property != null && property.IsEvent) |
|
|
|
DesignItemProperty property = item.Properties.GetProperty(dae.Name); |
|
|
|
{ |
|
|
|
if (property != null && property.IsEvent) |
|
|
|
return property; |
|
|
|
{ |
|
|
|
} |
|
|
|
return property; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|