Skip to content

Instantly share code, notes, and snippets.

@ntacheva
Last active May 14, 2021
Embed
What would you like to do?
<TestComponent Id="123"></TestComponent>
<TelerikButton OnClick="@ShowAlert">Show Alert</TelerikButton>
<TelerikButton OnClick="@ShowAlertWithTitle">Show Alert with Custom Title</TelerikButton>
@code {
[Parameter]
public int Id { get; set; }
protected override async Task OnParametersSetAsync()
{
Console.WriteLine(Id);
}
[CascadingParameter]
public DialogFactory Dialogs { get; set; }
public async Task ShowAlert()
{
await Dialogs.AlertAsync("Something went wrong!");
Console.WriteLine("The user dismissed the alert box.");
}
async Task ShowAlertWithTitle()
{
await Dialogs.AlertAsync("Something went wrong!", "Read this!");
Console.WriteLine("The user dismissed the alert box with the custom title.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment