Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.
Namespace: MindFusion.Mapping
Package: ObservableCollection.js
JavaScript Copy Code |
---|
EventDispatcher collectionChanged |
The event handler method receives the following arguments:
sender
An ObservableCollection instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A NotifyCollectionChangedEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.
The following code creates a new DecorationLayer and adds a new Marker to it. Then it handles the collectionChanged event of the decorations property of the DecorationLayer. The decorations property is of type ObservableCollection.
JavaScript Copy Code |
---|
var m = MindFusion.Mapping; var markers = new m.DecorationLayer("Images"); // create some markers with images markers.decorations.collectionChanged.addEventListener(handleCollectionChanged);
|