Export (0) Print
Expand All

ObservableCollection(Of T) Constructor (IEnumerable(Of T))

Updated: July 2008

Initializes a new instance of the ObservableCollection(Of T) class that contains elements copied from the specified collection.

Namespace:  System.Collections.ObjectModel
Assembly:  WindowsBase (in WindowsBase.dll)

'Declaration
Public Sub New ( _
	collection As IEnumerable(Of T) _
)
'Usage
Dim collection As IEnumerable(Of T)

Dim instance As New ObservableCollection(collection)
You cannot use constructors in XAML.

Parameters

collection
Type: System.Collections.Generic.IEnumerable(Of T)

The collection from which the elements are copied.

ExceptionCondition
ArgumentNullException

The collection parameter cannot be Nothing.

The elements are copied onto the ObservableCollection(Of T) in the same order they are read by the enumerator of the collection.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2

Date

History

Reason

July 2008

Added topic for new member.

SP1 feature change.

Community Additions

ADD
Show:
© 2014 Microsoft