[Blazor] Event handling - first InvokeAsync example with args (#32085)
parent
61dc10178c
commit
53cabce5c1
|
@ -635,9 +635,11 @@ Prefer the strongly typed <xref:Microsoft.AspNetCore.Components.EventCallback%60
|
|||
Invoke an <xref:Microsoft.AspNetCore.Components.EventCallback> or <xref:Microsoft.AspNetCore.Components.EventCallback%601> with <xref:Microsoft.AspNetCore.Components.EventCallback.InvokeAsync%2A> and await the <xref:System.Threading.Tasks.Task>:
|
||||
|
||||
```csharp
|
||||
await OnClickCallback.InvokeAsync();
|
||||
await OnClickCallback.InvokeAsync({ARGUMENT});
|
||||
```
|
||||
|
||||
In the preceding example, the `{ARGUMENT}` placeholder is an optional argument.
|
||||
|
||||
The following parent-child example demonstrates the technique.
|
||||
|
||||
`Child2.razor`:
|
||||
|
|
Loading…
Reference in New Issue