A
AMDRIT
Hello Everyone,
I am having an issue where an event appears to be fired repeatedly where I
only expect it to be fired once. See below for objects and behaviors.
I have a control that contains a treeview, it creates the TopLevel object
and subscribes to the ObjectChanged Event. When the event is fired, I
rebuild the treeview. If I change data from TopLevelData, the event is
fired just once. When I change data in ChildObject, the event is fired
multiple times. Perhaps the Event doesn't know it was heard and feels the
need to repeat itself.
I am sure I am missing something, anyone have any ideas what that is?
VB2005, WinXP
Here is a sample of what I am doing.
Class TopLevel
Readonly Property TopLevelData
Readonly Property ChildCollection
OnEvent ChildCollection.ListChanged, RaiseEvent ObjectChanged
OnEvent TopLevelData.PropertyChanged, RaiseEvent ObjectChanged
Class TopLevelData
On Property Change, RaiseEvent PropertyChanged
Class ChildCollection (ListOf ChildObject)
On Event ChildObject Property Change, RaiseEvent ListChanged
On Addition or Deletion of ChildObject, RaiseEvent ListChanged
Class ChildObject
On Property Change, RaiseEvent PropertyChanged
I am having an issue where an event appears to be fired repeatedly where I
only expect it to be fired once. See below for objects and behaviors.
I have a control that contains a treeview, it creates the TopLevel object
and subscribes to the ObjectChanged Event. When the event is fired, I
rebuild the treeview. If I change data from TopLevelData, the event is
fired just once. When I change data in ChildObject, the event is fired
multiple times. Perhaps the Event doesn't know it was heard and feels the
need to repeat itself.
I am sure I am missing something, anyone have any ideas what that is?
VB2005, WinXP
Here is a sample of what I am doing.
Class TopLevel
Readonly Property TopLevelData
Readonly Property ChildCollection
OnEvent ChildCollection.ListChanged, RaiseEvent ObjectChanged
OnEvent TopLevelData.PropertyChanged, RaiseEvent ObjectChanged
Class TopLevelData
On Property Change, RaiseEvent PropertyChanged
Class ChildCollection (ListOf ChildObject)
On Event ChildObject Property Change, RaiseEvent ListChanged
On Addition or Deletion of ChildObject, RaiseEvent ListChanged
Class ChildObject
On Property Change, RaiseEvent PropertyChanged