Class ReactiveCollectionViewSourceExtensions
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Extension methods for ReactiveCollectionViewSource<TSource>.
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
UICollectionViewCollection 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
UICollectionViewCollection view.
cellKey
NSStringCell 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
UICollectionViewCollection 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.