Browse Source

Do not create an event when the default event doesn't exist on double clicking an element.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/wpfdesigner@6275 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Kumar Devvrat 16 years ago
parent
commit
ed83e866e1
  1. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/AbstractEventHandlerService.cs

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/AbstractEventHandlerService.cs

@ -88,8 +88,9 @@ 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); DesignItemProperty property = item.Properties.GetProperty(dae.Name);
if (property != null && property.IsEvent) if (property != null && property.IsEvent)

Loading…
Cancel
Save