Share via


BlazorWebViewHandler.TryDispatchAsync(Action<IServiceProvider>) Method

Definition

Calls the specified workItem asynchronously and passes in the scoped services available to Razor components.

public:
 virtual System::Threading::Tasks::Task<bool> ^ TryDispatchAsync(Action<IServiceProvider ^> ^ workItem);
public virtual System.Threading.Tasks.Task<bool> TryDispatchAsync (Action<IServiceProvider> workItem);
abstract member TryDispatchAsync : Action<IServiceProvider> -> System.Threading.Tasks.Task<bool>
override this.TryDispatchAsync : Action<IServiceProvider> -> System.Threading.Tasks.Task<bool>
Public Overridable 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