-
Please tell me if this is a bug or a feature? var op = new SwalOption()
{
Category = SwalCategory.Warning,
Title = Resources.Strings.AppRes.ResourceManager.GetString("_Attention"),
Content = "Test",
ShowClose = false,
IsAutoHide = false,
ButtonTemplate = new RenderFragment(builder =>
{
builder.OpenComponent<DialogCloseButton>(0);
builder.AddAttribute(1, nameof(Button.Text), "Ok");
builder.AddAttribute(1, "class", "mt-4 btn btn-primary-fix btn-xxl btn-block");
builder.AddAttribute(1, nameof(Button.OnClick), TriggerAlertReset());
builder.CloseComponent();
})
};
SwalService.Show(op); Why is task |
Beta Was this translation helpful? Give feedback.
Answered by
Koreets61
Feb 21, 2025
Replies: 2 comments 7 replies
-
@Koreets61 could you create a repro repository for this issue? I think there may be some other problems. |
Beta Was this translation helpful? Give feedback.
7 replies
-
The solution on how to do it right, maybe it will be useful to someone. private async Task TriggerAlertReset()
{
}
var op = new SwalOption()
{
Category = SwalCategory.Warning,
Title = Resources.Strings.AppRes.ResourceManager.GetString("_Attention"),
Content = "Test",
ShowClose = false,
IsAutoHide = false,
ButtonTemplate = new RenderFragment(builder =>
{
builder.OpenElement(1, "button");
builder.AddAttribute(2, "class", "mt-4 btn btn-primary-fix btn-xxl btn-block");
builder.AddAttribute(3, "onclick", EventCallback.Factory.Create(this, TriggerAlertReset));
builder.AddContent(4, "Ok");
builder.CloseElement();
})
};
SwalService.Show(op); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Koreets61
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The solution on how to do it right, maybe it will be useful to someone.