Share via


ObservableCollectionExtensions.ToBindingList<T> Method

Definition

Returns a BindingList<T> implementation that stays in sync with the given ObservableCollection<T>.

public static System.ComponentModel.BindingList<T> ToBindingList<T> (this System.Collections.ObjectModel.ObservableCollection<T> source) where T : class;
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
public static System.ComponentModel.BindingList<T> ToBindingList<T> (this System.Collections.ObjectModel.ObservableCollection<T> source) where T : class;
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Requires calling MakeGenericType on the property descriptor's type")]
public static System.ComponentModel.BindingList<T> ToBindingList<T> (this System.Collections.ObjectModel.ObservableCollection<T> source) where T : class;
static member ToBindingList : System.Collections.ObjectModel.ObservableCollection<'T (requires 'T : null)> -> System.ComponentModel.BindingList<'T (requires 'T : null)> (requires 'T : null)
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")>]
static member ToBindingList : System.Collections.ObjectModel.ObservableCollection<'T (requires 'T : null)> -> System.ComponentModel.BindingList<'T (requires 'T : null)> (requires 'T : null)
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Requires calling MakeGenericType on the property descriptor's type")>]
static member ToBindingList : System.Collections.ObjectModel.ObservableCollection<'T (requires 'T : null)> -> System.ComponentModel.BindingList<'T (requires 'T : null)> (requires 'T : null)
<Extension()>
Public Function ToBindingList(Of T As Class) (source As ObservableCollection(Of T)) As BindingList(Of T)

Type Parameters

T

The element type.

Parameters

source
ObservableCollection<T>

The collection that the binding list will stay in sync with.

Returns

The binding list.

Attributes

Applies to