Skip to content

Instantly share code, notes, and snippets.

@ntacheva
Last active May 14, 2021 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntacheva/72a7771ebccd184967e6503902b911ab to your computer and use it in GitHub Desktop.
Save ntacheva/72a7771ebccd184967e6503902b911ab to your computer and use it in GitHub Desktop.
<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