ObservableCollectionListSource<T> Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
ObservableCollection<T> Rozšiřuje a přidává explicitní implementaci .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 prvků v kolekci.
- Dědičnost
-
ObservableCollectionListSource<T>
- Atributy
- Implementuje
Poznámky
Metoda GetList() je implementována k vrácení IBindingList implementace, která zůstává synchronizovaná s ObservableCollection.
Tuto třídu lze použít k implementaci navigačních vlastností u entit pro použití v model Windows Forms datové vazby. Pro WPF (Windows Presentation Foundation) datovou vazbu použijte místo instance této třídy observableCollection.
Další informace a příklady najdete v tématu Místní zobrazení sledovaných entit v EF Core .
Konstruktory
| Název | Description |
|---|---|
| ObservableCollectionListSource<T>() |
Inicializuje novou instanci ObservableCollectionListSource<T> třídy. |
| ObservableCollectionListSource<T>(IEnumerable<T>) |
Inicializuje novou instanci ObservableCollectionListSource<T> třídy, která obsahuje prvky zkopírované ze zadané kolekce. |
| ObservableCollectionListSource<T>(List<T>) |
Inicializuje novou instanci ObservableCollectionListSource<T> třídy, která obsahuje prvky zkopírované ze zadaného seznamu. |
Explicitní implementace rozhraní
| Název | Description |
|---|---|
| IListSource.ContainsListCollection |
Vždy false, protože neexistuje nikdy obsažená kolekce. |
| IListSource.GetList() |
IBindingList Vrátí implementaci, která zůstane synchronizovaná s tímto ObservableCollection<T>. Vrácený seznam je uložen v mezipaměti tohoto objektu tak, že stejný seznam je vrácen při každém zavolání této metody. |
Metody rozšíření
| Název | Description |
|---|---|
| ToBindingList<T>(ObservableCollection<T>) |
BindingList<T> Vrátí implementaci, která zůstane synchronizovaná s danou ObservableCollection<T>. |