Table of Contents

Class ReactiveRecyclerViewViewHolder<TViewModel>

Namespace
ReactiveUI.AndroidX
Assembly
ReactiveUI.AndroidX.dll

A AndroidX.RecyclerView.Widget.RecyclerView.ViewHolder implementation that binds to a reactive view model.

[RequiresDynamicCode("ReactiveRecyclerViewViewHolder inherits from ReactiveObject which uses extension methods that require dynamic code generation")]
[RequiresUnreferencedCode("ReactiveRecyclerViewViewHolder inherits from ReactiveObject which uses extension methods that may require unreferenced code")]
public class ReactiveRecyclerViewViewHolder<TViewModel> : RecyclerView.ViewHolder, ILayoutViewHost, IViewFor<TViewModel>, IViewFor, IActivatableView, IReactiveNotifyPropertyChanged<ReactiveRecyclerViewViewHolder<TViewModel>>, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger, ICanActivate where TViewModel : class, IReactiveObject

Type Parameters

TViewModel

The type of the view model.

Inheritance
ReactiveRecyclerViewViewHolder<TViewModel>
Implements
ILayoutViewHost
IViewFor<TViewModel>
IEnableLogger
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>, bool)

Constructors

ReactiveRecyclerViewViewHolder(View)

Initializes a new instance of the ReactiveRecyclerViewViewHolder<TViewModel> class.

protected ReactiveRecyclerViewViewHolder(View view)

Parameters

view View

The view.

Fields

AllPublicProperties

Gets all public accessible properties.

[IgnoreDataMember]
[JsonIgnore]
protected Lazy<PropertyInfo[]>? AllPublicProperties

Field Value

Lazy<PropertyInfo[]>

Properties

Activated

Gets a observable which is triggered when the ViewModel is activated.

public IObservable<Unit> Activated { get; }

Property Value

IObservable<Unit>

Changed

Gets an Observable that fires after a property has changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.

[IgnoreDataMember]
[JsonIgnore]
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changed { get; }

Property Value

IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>>

Changing

Gets an observable that fires before a property is about to be changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.

[IgnoreDataMember]
[JsonIgnore]
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changing { get; }

Property Value

IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>>

Deactivated

Gets a observable which is triggered when the ViewModel is deactivated.

public IObservable<Unit> Deactivated { get; }

Property Value

IObservable<Unit>

LongClicked

Gets an observable that signals that this ViewHolder has been long-clicked.

The int is the position of this ViewHolder in the AndroidX.RecyclerView.Widget.RecyclerView and corresponds to the AndroidX.RecyclerView.Widget.RecyclerView.ViewHolder.AbsoluteAdapterPosition property.

public IObservable<int> LongClicked { get; }

Property Value

IObservable<int>

LongClickedWithViewModel

Gets an observable that signals that this ViewHolder has been long-clicked.

The IObservable<T> is the ViewModel of this ViewHolder in the AndroidX.RecyclerView.Widget.RecyclerView.

public IObservable<TViewModel?> LongClickedWithViewModel { get; }

Property Value

IObservable<TViewModel>

Selected

Gets an observable that signals that this ViewHolder has been selected.

The int is the position of this ViewHolder in the AndroidX.RecyclerView.Widget.RecyclerView and corresponds to the AndroidX.RecyclerView.Widget.RecyclerView.ViewHolder.AbsoluteAdapterPosition property.

public IObservable<int> Selected { get; }

Property Value

IObservable<int>

SelectedWithViewModel

Gets an observable that signals that this ViewHolder has been selected.

The IObservable<T> is the ViewModel of this ViewHolder in the AndroidX.RecyclerView.Widget.RecyclerView.

public IObservable<TViewModel?> SelectedWithViewModel { get; }

Property Value

IObservable<TViewModel>

ThrownExceptions

Gets an observable which signals when exceptions are thrown.

[IgnoreDataMember]
[JsonIgnore]
public IObservable<Exception> ThrownExceptions { get; }

Property Value

IObservable<Exception>

View

Gets the current view being shown.

public View View { get; }

Property Value

View

ViewModel

Gets or sets the strongly typed view model. Override this property to integrate with the platform's binding system.

public TViewModel? ViewModel { get; set; }

Property Value

TViewModel

Methods

AreChangeNotificationsEnabled()

Gets if change notifications via the INotifyPropertyChanged interface are being sent.

public bool AreChangeNotificationsEnabled()

Returns

bool

A value indicating whether change notifications are enabled or not.

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

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, reenables change notifications.

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler

PropertyChanging

public event PropertyChangingEventHandler? PropertyChanging

Event Type

PropertyChangingEventHandler