Language

ObservableCollectionListSource<T> クラス

定義

ObservableCollection<T>を拡張し、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

型パラメーター

T

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

継承
ObservableCollectionListSource<T>
属性
実装

注釈

GetList()メソッドは、ObservableCollection と同期したIBindingList実装を返すために実装されます。

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

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

コンストラクター

Name 説明
ObservableCollectionListSource<T>()

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

ObservableCollectionListSource<T>(IEnumerable<T>)

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

ObservableCollectionListSource<T>(List<T>)

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

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

Name 説明
IListSource.ContainsListCollection

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

IListSource.GetList()

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

拡張メソッド

Name 説明
ToBindingList<T>(ObservableCollection<T>)

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

適用対象