Table of Contents

Class ReactiveCollectionViewSourceExtensions

Namespace
ReactiveUI
Assembly
ReactiveUI.dll
public static class ReactiveCollectionViewSourceExtensions : Object
Inheritance
ReactiveCollectionViewSourceExtensions

Methods

BindTo<TSource, TCell>(IObservable<IReadOnlyList<CollectionViewSectionInformation<TSource, TCell>>>, UICollectionView, Func<ReactiveCollectionViewSource<TSource>, IDisposable>?)

Extension method that binds an observable of a list of collection sections as the source of a UIKit.UICollectionView.

If your IReadOnlyList<T> is also an instance of INotifyCollectionChanged, then this method will silently update the bindings whenever it changes as well. Otherwise, it will just log a message.

public static IDisposable BindTo<TSource, TCell>(this IObservable<IReadOnlyList<CollectionViewSectionInformation<TSource, TCell>>> sectionsObservable, UICollectionView collectionView, Func<ReactiveCollectionViewSource<TSource>, IDisposable>? initSource = null) where TCell : UICollectionViewCell

Parameters

sectionsObservable IObservable<IReadOnlyList<CollectionViewSectionInformation<TSource, TCell>>>

Sections observable.

collectionView UICollectionView

Collection view.

initSource Func<ReactiveCollectionViewSource<TSource>, IDisposable>

Optionally initializes some property of the ReactiveCollectionViewSource<TSource>.

Returns

IDisposable

The IDisposable used to dispose this binding.

Type Parameters

TSource

Type of the view source.

TCell

Type of the UIKit.UICollectionViewCell.

BindTo<TSource, TCell>(IObservable<INotifyCollectionChanged>, UICollectionView, NSString, Action<TCell>?, Func<ReactiveCollectionViewSource<TSource>, IDisposable>?)

Extension method that binds an observable of a collection as the source of a UIKit.UICollectionView.

public static IDisposable BindTo<TSource, TCell>(this IObservable<INotifyCollectionChanged> sourceObservable, UICollectionView collectionView, NSString cellKey, Action<TCell>? initializeCellAction = null, Func<ReactiveCollectionViewSource<TSource>, IDisposable>? initSource = null) where TCell : UICollectionViewCell

Parameters

sourceObservable IObservable<INotifyCollectionChanged>

Source collection observable.

collectionView UICollectionView

Collection view.

cellKey NSString

Cell key.

initializeCellAction Action<TCell>

Initialize cell action.

initSource Func<ReactiveCollectionViewSource<TSource>, IDisposable>

Optionally initializes some property of the ReactiveCollectionViewSource<TSource>.

Returns

IDisposable

The IDisposable used to dispose this binding.

Type Parameters

TSource

Type of the source.

TCell

Type of the UIKit.UICollectionViewCell.

BindTo<TSource, TCell>(IObservable<INotifyCollectionChanged>, UICollectionView, Action<TCell>?, Func<ReactiveCollectionViewSource<TSource>, IDisposable>?)

Extension method that binds an observable of a collection as the source of a UIKit.UICollectionView. Also registers the given class with an unspecified cellKey (you should probably not specify any other cellKeys).

public static IDisposable BindTo<TSource, TCell>(this IObservable<INotifyCollectionChanged> sourceObservable, UICollectionView collectionView, Action<TCell>? initializeCellAction = null, Func<ReactiveCollectionViewSource<TSource>, IDisposable>? initSource = null) where TCell : UICollectionViewCell

Parameters

sourceObservable IObservable<INotifyCollectionChanged>

Source collection observable.

collectionView UICollectionView

Collection view.

initializeCellAction Action<TCell>

Initialize cell action.

initSource Func<ReactiveCollectionViewSource<TSource>, IDisposable>

Optionally initializes some property of the ReactiveCollectionViewSource<TSource>.

Returns

IDisposable

The IDisposable used to dispose this binding.

Type Parameters

TSource

Type of the source.

TCell

Type of the UIKit.UICollectionViewCell.