Table of Contents

Class ReactiveCollectionViewSource<TSource>

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

ReactiveCollectionViewSource is a Collection View Source that is connected to a Read Only List that automatically updates the View based on the contents of the list. The collection changes are buffered and View items are animated in and out as items are added.

public class ReactiveCollectionViewSource<TSource> : UICollectionViewSource, IReactiveNotifyPropertyChanged<ReactiveCollectionViewSource<TSource>>, IHandleObservableErrors, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger

Type Parameters

TSource

The source type.

Inheritance
ReactiveCollectionViewSource<TSource>
Implements
Extension Methods
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)

Constructors

ReactiveCollectionViewSource(UICollectionView)

Initializes a new instance of the ReactiveCollectionViewSource<TSource> class.

public ReactiveCollectionViewSource(UICollectionView collectionView)

Parameters

collectionView UICollectionView

The ui collection view.

ReactiveCollectionViewSource(UICollectionView, IReadOnlyList<CollectionViewSectionInformation<TSource>>)

Initializes a new instance of the ReactiveCollectionViewSource<TSource> class.

public ReactiveCollectionViewSource(UICollectionView collectionView, IReadOnlyList<CollectionViewSectionInformation<TSource>> sectionInformation)

Parameters

collectionView UICollectionView

The ui collection view.

sectionInformation IReadOnlyList<CollectionViewSectionInformation<TSource>>

The section information.

ReactiveCollectionViewSource(UICollectionView, INotifyCollectionChanged, NSString, Action<UICollectionViewCell>?)

Initializes a new instance of the ReactiveCollectionViewSource<TSource> class.

public ReactiveCollectionViewSource(UICollectionView collectionView, INotifyCollectionChanged collection, NSString cellKey, Action<UICollectionViewCell>? initializeCellAction = null)

Parameters

collectionView UICollectionView

The ui collection view.

collection INotifyCollectionChanged

The notify collection changed.

cellKey NSString

The cell key.

initializeCellAction Action<UICollectionViewCell>

The cell initialization action.

Properties

Changed

Gets an Observable that signals after a property has changed.

public IObservable<IReactivePropertyChangedEventArgs<ReactiveCollectionViewSource<TSource>>> Changed { get; }

Property Value

IObservable<IReactivePropertyChangedEventArgs<ReactiveCollectionViewSource<TSource>>>

Changing

Gets an Observable that signals before a property is about to be changed.

public IObservable<IReactivePropertyChangedEventArgs<ReactiveCollectionViewSource<TSource>>> Changing { get; }

Property Value

IObservable<IReactivePropertyChangedEventArgs<ReactiveCollectionViewSource<TSource>>>

Data

Gets or sets the data that should be displayed by this ReactiveCollectionViewSource<TSource>. You should probably bind your view model to this property. If the list implements INotifyCollectionChanged, then the source will react to changes to the contents of the list as well.

public IReadOnlyList<CollectionViewSectionInformation<TSource>> Data { get; set; }

Property Value

IReadOnlyList<CollectionViewSectionInformation<TSource>>

The data.

ElementSelected

Gets an IObservable that is a hook to ItemSelected(UICollectionView, NSIndexPath) calls.

public IObservable<object?> ElementSelected { get; }

Property Value

IObservable<object>

ThrownExceptions

Gets a observable which will fire whenever an exception would normally terminate ReactiveUI internal state.

public IObservable<Exception> ThrownExceptions { get; }

Property Value

IObservable<Exception>

Methods

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

GetCell(UICollectionView, NSIndexPath)

public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)

Parameters

collectionView UICollectionView
indexPath NSIndexPath

Returns

UICollectionViewCell

GetItemsCount(UICollectionView, nint)

public override nint GetItemsCount(UICollectionView collectionView, nint section)

Parameters

collectionView UICollectionView
section nint

Returns

nint

ItemAt(NSIndexPath)

Returns the Item at the specified index path.

public object? ItemAt(NSIndexPath indexPath)

Parameters

indexPath NSIndexPath

The index path.

Returns

object

The object at the specified index.

ItemSelected(UICollectionView, NSIndexPath)

public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)

Parameters

collectionView UICollectionView
indexPath NSIndexPath

NumberOfSections(UICollectionView)

public override nint NumberOfSections(UICollectionView collectionView)

Parameters

collectionView UICollectionView

Returns

nint

SuppressChangeNotifications()

When this method is called, an object will not fire change notifications (neither traditional nor Observable notifications) until the return value is disposed.

public IDisposable SuppressChangeNotifications()

Returns

IDisposable

An object that, when disposed, re-enables change notifications.

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler

PropertyChanging

public event PropertyChangingEventHandler? PropertyChanging

Event Type

PropertyChangingEventHandler