Show / Hide Table of Contents

Class ObserverObject

Observer object that encapsulates a reaction to automatically track dependencies and rerender when any of the dependencies change.

Inheritance
System.Object
ObserverObject
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cortex.Net.Blazor
Assembly: Cortex.Net.Blazor.dll
Syntax
public sealed class ObserverObject : IDisposable

Constructors

| Improve this Doc View Source

ObserverObject(ISharedState, String, Action<RenderTreeBuilder>, Action)

Initializes a new instance of the ObserverObject class.

Declaration
public ObserverObject(ISharedState sharedState, string name, Action<RenderTreeBuilder> buildRenderTreeAction, Action stateChangedAction)
Parameters
Type Name Description
ISharedState sharedState

The shared state this observer is connected to.

System.String name

The name of the observer.

System.Action<RenderTreeBuilder> buildRenderTreeAction

The action that should be executed to build the render tree.

System.Action stateChangedAction

The action that is used to force StateHasChanged for this Component.

Methods

| Improve this Doc View Source

BuildRenderTree(RenderTreeBuilder)

Builds the render tree for the Component and automatically tracks dependencies.

Declaration
public void BuildRenderTree(RenderTreeBuilder renderTreeBuilder)
Parameters
Type Name Description
RenderTreeBuilder renderTreeBuilder

The render tree builder to use.

| Improve this Doc View Source

Dispose()

Disposes the internal reaction that is used to track dependenies.

Declaration
public void Dispose()
| Improve this Doc View Source

ReactiveRenderFragment(RenderFragment)

Creates a reactive RenderFragment that tracks a RenderFragment. and Invokes the StateHasChanged action passed in the constructor when any of the fragments have changed.

Declaration
public RenderFragment ReactiveRenderFragment(RenderFragment renderFragment)
Parameters
Type Name Description
RenderFragment renderFragment

The render fragment to track.

Returns
Type Description
RenderFragment

A new Renderfragment that wraps the old one.

| Improve this Doc View Source

ReactiveRenderFragment<T>(RenderFragment<T>)

Creates a reactive RenderFragment that tracks a RenderFragment. and Invokes the StateHasChanged action passed in the constructor when any of the fragments have changed.

Declaration
public RenderFragment<T> ReactiveRenderFragment<T>(RenderFragment<T> renderFragment)
Parameters
Type Name Description
RenderFragment<T> renderFragment

The render fragment to encapsulate.

Returns
Type Description
RenderFragment<T>

The encapsulated render framgent.

Type Parameters
Name Description
T

The type of the argument.

Implements

System.IDisposable

Extension Methods

TraceExtensions.Trace<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>, TraceMode)
ReactiveObjectTypeUtilExtensions.GetObservable(Object)
ReactiveObjectTypeUtilExtensions.GetObservable<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX