Search
ObservableCollection.collectionChanging Event
See Also
Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: None Language Filter: C# Language Filter: Visual Basic Language Filter: Java Language Filter: JavaScript Language Filter: C++ Language Filter: XAML
C#
Visual Basic
Java
JavaScript
C++
XAML
Introduction
General Information
What's New In This Release
Version History
Getting Started
Code Completion With VSDoc IntelliSense
Programming Interface Overview
Tutorials
Reference
MindFusion.Common
MindFusion.Common.Collections
IEnumerable Class
List Class
ObservableCollection Class
ObservableCollection Members
ObservableCollection Constructor
ObservableCollection Methods
ObservableCollection Events
collectionChanged Event
collectionChanging Event
MindFusion.Controls
MindFusion.Scheduling
Licensing
Online Resources
Technical Support
MindFusion Products

Occurs just before an item is added, removed, changed, moved, or the entire list is refreshed.

Namespace: MindFusion.Common.Collections
Assembly: ObservableCollection.js

## Syntax

JavaScript Copy Code
EventDispatcher collectionChanging

## Event Data

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.

## Remarks

The cancel property of NotifyCollectionChangingEventArgs allows you to stop the action.

## Example

The following code handles the collectionChanging event on the items collection of a ListView object that is of type ObservableCollection:

JavaScript Copy Code
var nodeList = new ui.ListView(document.getElementById("nodeList")); nodeList.items.collectionChanging.addEventListener(itemsCollectionChangingEventHandler); function itemsCollectionChangingEventHandler(sender, args) { if(args.action == ui.NotifyCollectionChangedAction.Add) { //do something } }

## See Also

ObservableCollection Members
ObservableCollection Class
MindFusion.Common.Collections Namespace