Class ToastButtons
A list of buttons that are used to configure the Toast buttons.
Inheritance
Namespace: Syncfusion.Blazor.Notifications
Assembly: Syncfusion.Blazor.dll
Syntax
public class ToastButtons : OwningComponentBase
Remarks
The ToastButtons component is used as a container to define multiple action buttons for the Toast notification. It manages a collection of ToastButton instances that can be used to provide interactive elements within Toast notifications.
Examples
A simple ToastButtons component with action buttons.
<SfToast>
<ToastButtons>
<ToastButton Content="Accept" CssClass="e-success" OnClick="@AcceptHandler"></ToastButton>
<ToastButton Content="Cancel" CssClass="e-danger" OnClick="@CancelHandler"></ToastButton>
</ToastButtons>
</SfToast>
Constructors
ToastButtons()
Declaration
public ToastButtons()
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose()
Disposes the unmanaged resources used by the ToastButtons component.
Declaration
public virtual void Dispose()
Remarks
This method releases all resources used by the ToastButtons component, including clearing the action buttons collection and releasing references to child content and parent components.
Dispose(Boolean)
Disposes the resources used by the ToastButtons component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A |
Remarks
When disposing
is true
, this method releases all managed resources including the action buttons collection,
child content references, and parent component references.
OnAfterRenderAsync(Boolean)
Method invoked after each time the component has been rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | Set to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |
Remarks
This method updates the parent Toast component with the current collection of action buttons after each render cycle. It ensures that the parent Toast component is aware of all the configured action buttons.