Class ReactiveComponentBase<T>
- Namespace
- ReactiveUI.Blazor
- Assembly
- ReactiveUI.Blazor.dll
A base component for handling property changes and updating the blazer view appropriately.
public class ReactiveComponentBase<T> : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IViewFor<T>, IViewFor, IActivatableView, INotifyPropertyChanged, ICanActivate, IDisposable where T : class, INotifyPropertyChanged
Type Parameters
T
The type of view model. Must support INotifyPropertyChanged.
- Inheritance
-
ReactiveComponentBase<T>
- Implements
-
IViewFor<T>
- Inherited Members
- Extension Methods
Constructors
ReactiveComponentBase()
public ReactiveComponentBase()
Properties
Activated
Gets a observable which is triggered when the ViewModel is activated.
public IObservable<Unit> Activated { get; }
Property Value
- IObservable<Unit>
Deactivated
Gets a observable which is triggered when the ViewModel is deactivated.
public IObservable<Unit> Deactivated { get; }
Property Value
- IObservable<Unit>
ViewModel
Gets or sets the ViewModel corresponding to this specific View. This should be a DependencyProperty if you're using XAML.
[Parameter]
public T? ViewModel { get; set; }
Property Value
- T
Methods
Dispose()
public void Dispose()
Dispose(bool)
Cleans up the managed resources of the object.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolIf it is getting called by the Dispose() method rather than a finalizer.
OnAfterRender(bool)
protected override void OnAfterRender(bool firstRender)
Parameters
firstRender
bool
OnInitialized()
protected override void OnInitialized()
OnPropertyChanged(string?)
Invokes the property changed event.
protected virtual void OnPropertyChanged(string? propertyName = null)
Parameters
propertyName
stringThe name of the property.
Events
PropertyChanged
public event PropertyChangedEventHandler? PropertyChanged