WebViewManager.TryDispatchAsync(Action<IServiceProvider>) Method

Definition

Calls the specified workItem asynchronously and passes in the scoped services available to Razor components. This method will not throw any exceptions if it is unable to call the specified workItem, but if it does call it, then exceptions may still be thrown by the workItem itself.

public System.Threading.Tasks.Task<bool> TryDispatchAsync (Action<IServiceProvider> workItem);
member this.TryDispatchAsync : Action<IServiceProvider> -> System.Threading.Tasks.Task<bool>
Public Function TryDispatchAsync (workItem As Action(Of IServiceProvider)) As Task(Of Boolean)

Parameters

workItem
Action<IServiceProvider>

The action to call.

Returns

Returns a Task representing true if the workItem was called, or false if it was not called because Blazor is not currently running.

Exceptions

Thrown if workItem is null.

Applies to