ObservableCollectionListSource<T> Klasa
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
ObservableCollection<T> Rozszerza i dodaje jawną implementację elementu IListSource.
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })]
public class ObservableCollectionListSource<T> : System.Collections.ObjectModel.ObservableCollection<T>, System.ComponentModel.IListSource where T : class
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
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")>]
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })>]
type ObservableCollectionListSource<'T (requires 'T : null)> = class
inherit ObservableCollection<'T (requires 'T : null)>
interface IListSource
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 na jednostkach do użycia w powiązaniu danych Windows Forms. W przypadku WPF powiązanie danych należy użyć klasy ObservableCollection, a nie wystąpienia tej klasy.
Aby uzyskać więcej informacji i przykładów, zobacz Lokalne widoki śledzonych jednostek w programie EF Core .
Konstruktory
| Nazwisko | Opis |
|---|---|
| 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 nowe wystąpienie ObservableCollectionListSource<T> klasy zawierającej elementy skopiowane z określonej listy. |
Jawne implementacje interfejsu
| Nazwisko | Opis |
|---|---|
| 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 . Zwrócona 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
| Nazwisko | Opis |
|---|---|
| ToBindingList<T>(ObservableCollection<T>) |
Zwraca implementację BindingList<T> , która pozostaje zsynchronizowana z danym ObservableCollection<T>elementem . |