Method SetSource
SetSource<T>(ObservableCollection<T>?)
Sets the items from an ObservableCollection<T> using the default IListDataSource for collections.
public void SetSource<T>(ObservableCollection<T>? source)
Parameters
sourceObservableCollection<T>The collection to display, or null to clear items through the default collection data-source path (see remarks).
Type Parameters
T
Remarks
When source is non-null, Source is set to
an IListDataSource that wraps that collection (the built-in implementation is
ListWrapper<T>).
When source is null:
-
If Source is already the default collection data source for
T, it is replaced with an empty default data source (Count is 0). Source stays non-null. - Otherwise (no source, or a custom IListDataSource), Source is set to null.
To always detach the data source regardless of its type, assign Source = null.