Class ReactiveLayoutComponentBase<T>
- Namespace
- ReactiveUI.Blazor
- Assembly
- ReactiveUI.Blazor.dll
A base component for handling property changes and updating the blazer view appropriately.
public class ReactiveLayoutComponentBase<T> : LayoutComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IViewFor<T>, IViewFor, IActivatableView, INotifyPropertyChanged, ICanActivate, IDisposable where T : class, INotifyPropertyChanged
Type Parameters
TThe type of view model. Must support INotifyPropertyChanged.
- Inheritance
-
ReactiveLayoutComponentBase<T>
- Implements
-
IView
For <T>
- Inherited Members
- Extension Methods
Constructors
ReactiveLayoutComponentBase()
Properties
Activated
Gets a observable which is triggered when the ViewModel is activated.
Property Value
- IObservable<Unit>
Deactivated
Gets a observable which is triggered when the ViewModel is deactivated.
Property Value
- IObservable<Unit>
ViewModel
Gets or sets the strongly typed view model. Override this property to integrate with the platform's binding system.
Property Value
- T
Methods
Dispose()
Dispose(bool)
Cleans up the managed resources of the object.
Parameters
disposingboolIf it is getting called by the Dispose() method rather than a finalizer.
OnAfterRender(bool)
Method invoked after each time the component has rendered interactively and the UI has finished
updating (for example, after elements have been added to the browser DOM). Any Element
This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.
[RequiresDynamicCode("OnAfterRender uses methods that require dynamic code generation")]
[RequiresUnreferencedCode("OnAfterRender uses methods that may require unreferenced code")]
protected override void OnAfterRender(bool isFirstRender)
Parameters
isFirstRenderbool
Remarks
The On@ref.
Use the firstRender parameter to ensure that initialization work is only performed
once.
OnInitialized()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
OnPropertyChanged(string?)
Invokes the property changed event.
Parameters
propertyNamestringThe name of the property.