ObservableCollectionListSource<T> Klasa

Definicja

ObservableCollection<T> Rozszerza i dodaje jawną implementację elementu IListSource.

public class ObservableCollectionListSource<T> : System.Collections.ObjectModel.ObservableCollection<T>, System.ComponentModel.IListSource where T : class
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
public class ObservableCollectionListSource<T> : System.Collections.ObjectModel.ObservableCollection<T>, System.ComponentModel.IListSource where T : class
type ObservableCollectionListSource<'T (requires 'T : null)> = class
    inherit ObservableCollection<'T (requires 'T : null)>
    interface IListSource
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")>]
type ObservableCollectionListSource<'T (requires 'T : null)> = class
    inherit ObservableCollection<'T (requires 'T : null)>
    interface IListSource
Public Class ObservableCollectionListSource(Of T)
Inherits ObservableCollection(Of T)
Implements IListSource

Parametry typu

T

Typ elementów w kolekcji.

Dziedziczenie
ObservableCollectionListSource<T>
Atrybuty
Implementuje

Uwagi

Metoda GetList() jest implementowana w celu zwrócenia IBindingList implementacji, która pozostaje zsynchronizowana z obiektem ObservableCollection.

Ta klasa może służyć do implementowania właściwości nawigacji dla jednostek do użycia w powiązaniu danych Windows Forms. W przypadku powiązania danych WPF należy użyć klasy ObservableCollection, a nie wystąpienia tej klasy.

Aby uzyskać więcej informacji i przykłady, zobacz Lokalne widoki śledzonych jednostek w programie EF Core .

Konstruktory

ObservableCollectionListSource<T>()

Inicjuje nowe wystąpienie klasy ObservableCollectionListSource<T>.

ObservableCollectionListSource<T>(IEnumerable<T>)

Inicjuje ObservableCollectionListSource<T> nowe wystąpienie klasy zawierające elementy skopiowane z określonej kolekcji.

ObservableCollectionListSource<T>(List<T>)

Inicjuje ObservableCollectionListSource<T> nowe wystąpienie klasy zawierające elementy skopiowane z określonej listy.

Jawne implementacje interfejsu

IListSource.ContainsListCollection

Zawsze fałsz, ponieważ nigdy nie ma zawartej kolekcji.

IListSource.GetList()

Zwraca implementację IBindingList , która pozostaje zsynchronizowana z tym ObservableCollection<T>elementem . Zwracana lista jest buforowana na tym obiekcie, tak aby ta sama lista została zwrócona za każdym razem, gdy ta metoda jest wywoływana.

Metody rozszerzania

ToBindingList<T>(ObservableCollection<T>)

Zwraca implementację BindingList<T> , która pozostaje zsynchronizowana z danym ObservableCollection<T>elementem .

Dotyczy