赞
踩
@inject DialogService DialogService
或者后置代码
[Inject]
[NotNull]
private DialogService? DialogService { get; set; }
await DialogService.Show(new DialogOption()
{
Title = "运行结果",
IsScrolling = true,
IsCentered = true,
BodyTemplate = new RenderFragment(builder =>
{
builder.OpenElement(1, "p");
builder.AddContent(2, "结果1结果2结果3结果4");
builder.CloseElement();
})
});
[Inject]
[NotNull]
private SwalService? SwalService { get; set; }
var op = new SwalOption()
{
Title = Localizer["SwalOptionTitle"],
Content = Localizer["SwalOptionContent"]
};
var ret = await SwalService.ShowModal(op);
DialogService.Show(new DialogOption()
{
Title = "Built-in Counter component",
Component = BootstrapDynamicComponent.CreateComponent<Counter>()
});
string CurrentDirectory = ""; void LoadFiles() { } public class NewFolders { [DisplayName("文件夹名称")] public string NewFolderName { get; set; } } private async Task ShowNewFolderDialog() { var newFolders = new NewFolders(); var option = new EditDialogOption<NewFolders>() { Title = "新文件夹名称", Model = newFolders, OnEditAsync = context => { string path = Path.Combine(CurrentDirectory, newFolders.NewFolderName); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); LoadFiles(); } return Task.FromResult(true); } }; await DialogService.ShowEditDialog(option); }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。