Class ReactiveViewHost<TViewModel>
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
A class that implements the Android ViewHolder pattern with a ViewModel. Use it along with GetViewHost.
public abstract class ReactiveViewHost<TViewModel> : LayoutViewHost, ILayoutViewHost, IViewFor<TViewModel>, IViewFor, IActivatableView, IReactiveNotifyPropertyChanged<ReactiveViewHost<TViewModel>>, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger where TViewModel : class, IReactiveObject
Type Parameters
TViewModel
The view model type.
- Inheritance
-
ReactiveViewHost<TViewModel>
- Implements
-
IViewFor<TViewModel>IReactiveNotifyPropertyChanged<ReactiveViewHost<TViewModel>>
- Inherited Members
- Extension Methods
Constructors
ReactiveViewHost()
Initializes a new instance of the ReactiveViewHost<TViewModel> class.
protected ReactiveViewHost()
ReactiveViewHost(Context, int, ViewGroup, bool, bool)
Initializes a new instance of the ReactiveViewHost<TViewModel> class.
protected ReactiveViewHost(Context ctx, int layoutId, ViewGroup parent, bool attachToRoot = false, bool performAutoWireup = true)
Parameters
ctx
ContextThe CTX.
layoutId
intThe layout identifier.
parent
ViewGroupThe parent.
attachToRoot
boolif set to
true
[attach to root].performAutoWireup
boolif set to
true
[perform automatic wire-up].
Fields
allPublicProperties
All public properties.
[JsonIgnore]
protected Lazy<PropertyInfo[]>? allPublicProperties
Field Value
- Lazy<PropertyInfo[]>
Properties
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.
[JsonIgnore]
public IObservable<IReactivePropertyChangedEventArgs<ReactiveViewHost<TViewModel>>> Changed { get; }
Property Value
- IObservable<IReactivePropertyChangedEventArgs<ReactiveViewHost<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.
[JsonIgnore]
public IObservable<IReactivePropertyChangedEventArgs<ReactiveViewHost<TViewModel>>> Changing { get; }
Property Value
- IObservable<IReactivePropertyChangedEventArgs<ReactiveViewHost<TViewModel>>>
ThrownExceptions
Gets the thrown exceptions.
[JsonIgnore]
public IObservable<Exception> ThrownExceptions { get; }
Property Value
ViewModel
Gets or sets the ViewModel corresponding to this specific View. This should be a DependencyProperty if you're using XAML.
public TViewModel? ViewModel { get; set; }
Property Value
- TViewModel
Methods
AreChangeNotificationsEnabled()
Gets a value indicating if change notifications are enabled.
public bool AreChangeNotificationsEnabled()
Returns
- bool
A value indicating if change notifications are on or off.
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
PropertyChanging
public event PropertyChangingEventHandler? PropertyChanging