Alerts can be triggered from code and disappear after the specified duration.
The AlertService
triggers notifications to be displayed on top of the current page.
To use the AlertService
, add the <PureAlertProvider/>
component to your page.
<PureButton OnClick="() => AddAlert(Success)">Success</PureButton>
<PureAlertProvider />
@code {
[Inject]
</PureFlyout>
public AlertService Service { get@code {
public bool ShowFlyout { get; set; }
public void OpenFlyout()
{
ShowFlyout = true;
}
}
; set; }
public async Task AddAlert(Accent state)
{
await Service.ShowAsync("Adding your alert...", state);
}
}