Dela via


Renderer Class

Definition

Types in the Microsoft.AspNetCore.Components.RenderTree are not recommended for use outside of the Blazor framework. These types will change in a future release.

public ref class Renderer abstract : IDisposable
public ref class Renderer abstract : IAsyncDisposable, IDisposable
public abstract class Renderer : IDisposable
public abstract class Renderer : IAsyncDisposable, IDisposable
type Renderer = class
    interface IDisposable
type Renderer = class
    interface IDisposable
    interface IAsyncDisposable
Public MustInherit Class Renderer
Implements IDisposable
Public MustInherit Class Renderer
Implements IAsyncDisposable, IDisposable
Inheritance
Renderer
Derived
Implements

Constructors

Renderer(IServiceProvider, ILoggerFactory, IComponentActivator)

Constructs an instance of Renderer.

Renderer(IServiceProvider, ILoggerFactory)

Constructs an instance of Renderer.

Properties

Assets

Gets the ResourceAssetCollection associated with this Renderer.

Dispatcher

Gets the Dispatcher associated with this Renderer.

ElementReferenceContext

Gets or sets the ElementReferenceContext associated with this Renderer, if it exists.

RendererInfo

Gets the RendererInfo associated with this Renderer.

Methods

AddPendingTask(ComponentState, Task)

Notifies the renderer that there is a pending task associated with a component. The renderer is regarded as quiescent when all such tasks have completed.

AssignRootComponentId(IComponent)

Associates the IComponent with the Renderer, assigning an identifier that is unique within the scope of the Renderer.

CreateComponentState(Int32, IComponent, ComponentState)

Creates a ComponentState instance to track state associated with a newly-instantiated component. This is called before the component is initialized and tracked within the Renderer. Subclasses may override this method to use their own subclasses of ComponentState.

DispatchEventAsync(UInt64, EventFieldInfo, EventArgs, Boolean)

Notifies the renderer that an event has occurred.

DispatchEventAsync(UInt64, EventFieldInfo, EventArgs)

Notifies the renderer that an event has occurred.

Dispose()

Releases all resources currently used by this Renderer instance.

Dispose(Boolean)

Releases all resources currently used by this Renderer instance.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

GetComponentRenderMode(IComponent)

Gets the IComponentRenderMode for a given component if available.

GetComponentState(IComponent)

Resolves the component state for a given IComponent instance.

GetComponentState(Int32)

Gets the ComponentState associated with the specified component.

GetCurrentRenderTreeFrames(Int32)

Gets the current render tree for a given component.

GetEventArgsType(UInt64)

Gets the event arguments type for the specified event handler.

HandleException(Exception)

Allows derived types to handle exceptions during rendering. Defaults to rethrowing the original exception.

InstantiateComponent(Type)

Constructs a new component of the specified type.

ProcessPendingRender()

Processes pending renders requests from components if there are any.

RemoveRootComponent(Int32)

Removes the specified component from the renderer, causing the component and its descendants to be disposed.

RenderRootComponentAsync(Int32, ParameterView)

Supplies parameters for a root component, normally causing it to render. This can be used to trigger the first render of a root component, or to update its parameters and trigger a subsequent render. Note that components may also make their own decisions about when to re-render, and may re-render at any time.

The returned Task waits for this component and all descendant components to finish rendering in case there is any asynchronous work being done by any of them.

RenderRootComponentAsync(Int32)

Performs the first render for a root component, waiting for this component and all children components to finish rendering in case there is any asynchronous work being done by any of the components. After this, the root component makes its own decisions about when to re-render, so there is no need to call this more than once.

ResolveComponentForRenderMode(Type, Nullable<Int32>, IComponentActivator, IComponentRenderMode)

Determines how to handle an IComponentRenderMode when obtaining a component instance. This is only called when a render mode is specified either at the call site or on the component type.

Subclasses may override this method to return a component of a different type, or throw, depending on whether the renderer supports the render mode and how it implements that support.

UpdateDisplayAsync(RenderBatch)

Updates the visible UI.

Events

UnhandledSynchronizationException

Allows the caller to handle exceptions from the SynchronizationContext when one is available.

Applies to