ObservableCollectionListSource<T> クラス

定義

を拡張 ObservableCollection<T> し、 の明示的な実装を 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

型パラメーター

T

コレクション内の要素の型。

継承
ObservableCollectionListSource<T>
属性
実装

注釈

メソッド GetList() は、ObservableCollection との同期を IBindingList 維持する実装を返すために実装されています。

このクラスは、Windows フォームデータ バインディングで使用するエンティティにナビゲーション プロパティを実装するために使用できます。 WPF データ バインディングでは、このクラスのインスタンスではなく ObservableCollection を使用します。

詳細と例については、「 EF Core の追跡対象エンティティのローカル ビュー 」を参照してください。

コンストラクター

ObservableCollectionListSource<T>()

ObservableCollectionListSource<T> クラスの新しいインスタンスを初期化します。

ObservableCollectionListSource<T>(IEnumerable<T>)

指定したコレクションからコピーされた要素を格納する、ObservableCollectionListSource<T> クラスの新しいインスタンスを初期化します。

ObservableCollectionListSource<T>(List<T>)

指定したリストからコピーされた要素を格納する ObservableCollectionListSource<T> クラスの新しいインスタンスを初期化します。

明示的なインターフェイスの実装

IListSource.ContainsListCollection

含まれているコレクションは存在しないため、常に false です。

IListSource.GetList()

この ObservableCollection<T>IBindingList同期したままの実装を返します。 返されたリストは、このメソッドが呼び出されるたびに同じリストが返されるように、このオブジェクトにキャッシュされます。

拡張メソッド

ToBindingList<T>(ObservableCollection<T>)

指定ObservableCollection<T>した とBindingList<T>同期したままの実装を返します。

適用対象