protected async override Task OnInitializedAsync() { var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main); ToolbarItemRenders.Clear(); foreach (var item in toolbar.Items) { ToolbarItemRenders.Add(builder => { builder.OpenComponent(0, item.ComponentType); builder.CloseComponent(); }); } }
private async Task GetToolbarItemRendersAsync() { var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main); ToolbarItemRenders.Clear(); var sequence = 0; foreach (var item in toolbar.Items) { ToolbarItemRenders.Add(builder => { builder.OpenComponent(sequence++, item.ComponentType); builder.CloseComponent(); }); } }