Occurs just before an item is added, removed, changed, moved, or the entire list is refreshed.
Namespace: MindFusion.Mapping
Package: ObservableCollection.js
JavaScript Copy Code |
---|
EventDispatcher collectionChanging |
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 NotifyCollectionChangingEventArgs 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 the decorations property. Then it handles the collectionChanging event. It checks if the user is trying to add a new item to the collection and if so - cancels the action. 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
|