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
Constructors
ReactiveCollectionViewSource(UICollectionView)
Initializes a new instance of the ReactiveCollectionViewSource<TSource> class.
public ReactiveCollectionViewSource(UICollectionView collectionView)
Parameters
collectionView
UICollectionViewThe 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
UICollectionViewThe 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
UICollectionViewThe ui collection view.
collection
INotifyCollectionChangedThe notify collection changed.
cellKey
NSStringThe 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
Changing
Gets an Observable that signals before a property is about to be changed.
public IObservable<IReactivePropertyChangedEventArgs<ReactiveCollectionViewSource<TSource>>> Changing { get; }
Property Value
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
ThrownExceptions
Gets a observable which will fire whenever an exception would normally terminate ReactiveUI internal state.
public IObservable<Exception> ThrownExceptions { get; }
Property Value
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
UICollectionViewindexPath
NSIndexPath
Returns
- UICollectionViewCell
GetItemsCount(UICollectionView, nint)
public override nint GetItemsCount(UICollectionView collectionView, nint section)
Parameters
collectionView
UICollectionViewsection
nint
Returns
- nint
ItemAt(NSIndexPath)
Returns the Item at the specified index path.
public object? ItemAt(NSIndexPath indexPath)
Parameters
indexPath
NSIndexPathThe index path.
Returns
- object
The object at the specified index.
ItemSelected(UICollectionView, NSIndexPath)
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
Parameters
collectionView
UICollectionViewindexPath
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
PropertyChanging
public event PropertyChangingEventHandler? PropertyChanging