From a0d8d4d3349e0411181dc3a9191426e1fcb50127 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 08:48:48 +0800 Subject: [PATCH 01/10] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=87=8F=E5=B0=91=E7=BA=A7=E8=81=94=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Layout/Layout.razor.cs | 2 +- src/BootstrapBlazor/Components/Tab/Tab.razor | 125 +++++++++--------- .../Components/Tab/Tab.razor.cs | 8 +- 3 files changed, 65 insertions(+), 70 deletions(-) diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs index 617254755b1..1938cd1ed95 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs @@ -33,7 +33,7 @@ public partial class Layout : IHandlerException /// Gets or sets the template of the toolbar button. Default is null. /// [Parameter] - public RenderFragment? ToolbarTemplate { get; set; } + public RenderFragment? ToolbarTemplate { get; set; } /// /// Gets or sets whether show the full screen button. Default is true. diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor b/src/BootstrapBlazor/Components/Tab/Tab.razor index d86840e722c..ab05d521f90 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor @@ -34,12 +34,7 @@ else if (ShowContextMenu) } else { - @RenderTab -} - -@code { - RenderFragment RenderTab => - @
+
@if (TabHeader != null) { TabHeader.Render(RenderTabHeader); @@ -67,15 +62,17 @@ else }
-
; + +} +@code { RenderFragment RenderTabHeader => @
@if (BeforeNavigatorTemplate != null) { - @BeforeNavigatorTemplate + @BeforeNavigatorTemplate(this) } @if (ShowNavigatorButtons) @@ -140,63 +137,61 @@ else }
- - @if (ButtonTemplate != null) - { - @ButtonTemplate - } - @if (ShowToolbar) - { -
- @if (ShowRefreshToolbarButton) - { - - } - @if (ShowFullscreenToolbarButton) - { -
- -
- } - @if (ToolbarTemplate != null) - { - @ToolbarTemplate - } -
- } - @if (ShowNavigatorButtons) - { - - } - @if (ShouldShowExtendButtons()) - { - - - } - @if (AfterNavigatorTemplate != null) - { - @AfterNavigatorTemplate - } -
+ @if (ButtonTemplate != null) + { + @ButtonTemplate(this) + } + @if (ShowToolbar) + { +
+ @if (ShowRefreshToolbarButton) + { + + } + @if (ShowFullscreenToolbarButton) + { +
+ +
+ } + @if (ToolbarTemplate != null) + { + @ToolbarTemplate(this) + } +
+ } + @if (ShowNavigatorButtons) + { + + } + @if (ShouldShowExtendButtons()) + { + + + } + @if (AfterNavigatorTemplate != null) + { + @AfterNavigatorTemplate(this) + } ; diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index ce030c1cbbb..8cf6ffec219 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -228,27 +228,27 @@ public partial class Tab : IHandlerException /// 获得/设置 按钮模板 默认 null ///
[Parameter] - public RenderFragment? ButtonTemplate { get; set; } + public RenderFragment? ButtonTemplate { get; set; } /// /// Gets or sets the template of the toolbar button. Default is null. /// [Parameter] - public RenderFragment? ToolbarTemplate { get; set; } + public RenderFragment? ToolbarTemplate { get; set; } /// /// 获得/设置 标签页前置模板 默认 null /// 在向前移动标签页按钮前 /// [Parameter] - public RenderFragment? BeforeNavigatorTemplate { get; set; } + public RenderFragment? BeforeNavigatorTemplate { get; set; } /// /// 获得/设置 标签页后置模板 默认 null /// 在向后移动标签页按钮前 /// [Parameter] - public RenderFragment? AfterNavigatorTemplate { get; set; } + public RenderFragment? AfterNavigatorTemplate { get; set; } /// /// 获得/设置 上一个标签图标 From 6dca791d9d3a25c3ed0e971923e611ecf88f4b39 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 12:19:49 +0800 Subject: [PATCH 02/10] =?UTF-8?q?refactor:=20=E5=87=8F=E5=B0=91=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor b/src/BootstrapBlazor/Components/Tab/Tab.razor index ab05d521f90..a5d164c3563 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor @@ -71,9 +71,7 @@ else
@if (BeforeNavigatorTemplate != null) { - - @BeforeNavigatorTemplate(this) - + @BeforeNavigatorTemplate(this) } @if (ShowNavigatorButtons) { From 28c2b7f6aad0aeec91725508e2b87f2ede0ba5d1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 12:46:00 +0800 Subject: [PATCH 03/10] =?UTF-8?q?refactor:=20=E4=BD=BF=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AE=8C=E6=88=90=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor | 66 +------------------ .../Components/Tab/Tab.razor.cs | 51 ++++++++++++++ 2 files changed, 52 insertions(+), 65 deletions(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor b/src/BootstrapBlazor/Components/Tab/Tab.razor index a5d164c3563..672ff068a85 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor @@ -6,32 +6,6 @@ { @Body } -else if (ShowContextMenu) -{ - - @RenderTab - - @if (BeforeContextMenuTemplate != null) - { - @BeforeContextMenuTemplate(this) - } - - - - - - @if (ShowContextMenuFullScreen) - { - - - } - @if (ContextMenuTemplate != null) - { - @ContextMenuTemplate(this) - } - - -} else {
@@ -89,45 +63,7 @@ else @ChildContent - @if (!Items.Any() && !string.IsNullOrEmpty(DefaultUrl)) - { - if (ClickTabToNavigation) - { - Navigator.NavigateTo(DefaultUrl); - } - else - { - AddTabItem(DefaultUrl); - } - } - @if (FirstRender) - { - if (!Items.Any(t => t.IsActive)) - { - Items.FirstOrDefault(i => i.IsDisabled == false)?.SetActive(true); - } - } - @foreach (var item in Items) - { - @if (item.HeaderTemplate != null) - { -
- @item.HeaderTemplate(item) -
- } - else if (item.IsDisabled) - { - @RenderDisabledHeaderItem(item) - } - else - { - @RenderHeaderItem(item) - } - } - @if (IsCard || IsBorderCard) - { -
- } + @RenderTabList()
@if (!IsCard && !IsBorderCard && ShowActiveBar) { diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index 8cf6ffec219..4194ca20a40 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -1132,6 +1132,57 @@ private async Task OnContextMenu(MouseEventArgs e, TabItem item) } } + private RenderFragment RenderTabList() => builder => + { + if (!Items.Any() && !string.IsNullOrEmpty(DefaultUrl)) + { + if (ClickTabToNavigation) + { + Navigator.NavigateTo(DefaultUrl); + } + else + { + AddTabItem(DefaultUrl); + } + } + + if (FirstRender) + { + if (!Items.Any(t => t.IsActive)) + { + Items.FirstOrDefault(i => i.IsDisabled == false)?.SetActive(true); + } + } + + foreach (var item in Items) + { + if (item.HeaderTemplate != null) + { + builder.OpenElement(0, "div"); + builder.SetKey(item); + builder.AddAttribute(10, "class", GetItemWrapClassString(item)); + builder.AddAttribute(20, "draggable", DraggableString); + builder.AddContent(30, item.HeaderTemplate(item)); + builder.CloseElement(); + } + else if (item.IsDisabled) + { + builder.AddContent(40, RenderDisabledHeaderItem(item)); + } + else + { + builder.AddContent(50, RenderHeaderItem(item)); + } + } + + if (IsCard || IsBorderCard) + { + builder.OpenElement(100, "div"); + builder.AddAttribute(110, "class", "tabs-item-fix"); + builder.CloseElement(); + } + }; + /// /// /// From ecb2bdcb246a3be9b04dbdb747a158e68e54cf7d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 12:58:06 +0800 Subject: [PATCH 04/10] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=20fix=20?= =?UTF-8?q?=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor.cs | 2 +- src/BootstrapBlazor/Components/Tab/Tab.razor.scss | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index 4194ca20a40..c5bf4782f20 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -1175,7 +1175,7 @@ private RenderFragment RenderTabList() => builder => } } - if (IsCard || IsBorderCard) + if (TabStyle == TabStyle.Default && (IsCard || IsBorderCard)) { builder.OpenElement(100, "div"); builder.AddAttribute(110, "class", "tabs-item-fix"); diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.scss b/src/BootstrapBlazor/Components/Tab/Tab.razor.scss index 4747744c25c..f98299ada48 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.scss +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.scss @@ -501,10 +501,6 @@ --bb-tabs-item-text-padding: 0 .5rem; background-color: var(--bb-tabs-header-bg-color); - .tabs-item-fix { - border: none; - } - .tabs-item-wrap { &:not(.active) { .tabs-item:not(.disabled) .tabs-item-body { From 424ddb9fe9ab2d94622ab3c6a3ab8833f076a72b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 13:10:33 +0800 Subject: [PATCH 05/10] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor | 22 +++++++++ .../Components/Tab/Tab.razor.cs | 46 +++++++++++++------ 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor b/src/BootstrapBlazor/Components/Tab/Tab.razor index 672ff068a85..d18439f1a19 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor @@ -128,6 +128,28 @@ else }
; + + RenderFragment RenderContextMenu => + @ + @if (BeforeContextMenuTemplate != null) + { + @BeforeContextMenuTemplate(this) + } + + + + + + @if (ShowContextMenuFullScreen) + { + + + } + @if (ContextMenuTemplate != null) + { + @ContextMenuTemplate(this) + } + ; RenderFragment RenderTabItem => item => @ diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index c5bf4782f20..288206da24c 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -1154,33 +1154,51 @@ private RenderFragment RenderTabList() => builder => } } - foreach (var item in Items) + if (ShowContextMenu) { + builder.OpenComponent(0); + builder.AddComponentReferenceCapture(10, instance => _contextMenuZone = (ContextMenuZone)instance); + builder.AddContent(20, RenderTabItems()); + builder.AddContent(30, RenderContextMenu); + builder.CloseComponent(); + } + else + { + builder.AddContent(150, RenderTabItems()); + } + + if (TabStyle == TabStyle.Default && (IsCard || IsBorderCard)) + { + builder.OpenElement(200, "div"); + builder.AddAttribute(210, "class", "tabs-item-fix"); + builder.CloseElement(); + } + }; + + private RenderFragment RenderTabItems() => builder => + { + for (var index = 0; index < _items.Count; index++) + { + var item = _items[index]; + var sequence = (index + 1) * 100; if (item.HeaderTemplate != null) { - builder.OpenElement(0, "div"); + builder.OpenElement(sequence, "div"); builder.SetKey(item); - builder.AddAttribute(10, "class", GetItemWrapClassString(item)); - builder.AddAttribute(20, "draggable", DraggableString); - builder.AddContent(30, item.HeaderTemplate(item)); + builder.AddAttribute(sequence + 10, "class", GetItemWrapClassString(item)); + builder.AddAttribute(sequence + 20, "draggable", DraggableString); + builder.AddContent(sequence + 30, item.HeaderTemplate(item)); builder.CloseElement(); } else if (item.IsDisabled) { - builder.AddContent(40, RenderDisabledHeaderItem(item)); + builder.AddContent(sequence + 40, RenderDisabledHeaderItem(item)); } else { - builder.AddContent(50, RenderHeaderItem(item)); + builder.AddContent(sequence + 50, RenderHeaderItem(item)); } } - - if (TabStyle == TabStyle.Default && (IsCard || IsBorderCard)) - { - builder.OpenElement(100, "div"); - builder.AddAttribute(110, "class", "tabs-item-fix"); - builder.CloseElement(); - } }; /// From 0afa3f8db7ceae09022766db6d01a9cbfb7369d3 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 13:27:19 +0800 Subject: [PATCH 06/10] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index 288206da24c..a392c131885 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -1157,9 +1157,8 @@ private RenderFragment RenderTabList() => builder => if (ShowContextMenu) { builder.OpenComponent(0); - builder.AddComponentReferenceCapture(10, instance => _contextMenuZone = (ContextMenuZone)instance); - builder.AddContent(20, RenderTabItems()); - builder.AddContent(30, RenderContextMenu); + builder.AddAttribute(10, nameof(ContextMenuZone.ChildContent), RenderContextMenuZoneContent()); + builder.AddComponentReferenceCapture(20, instance => _contextMenuZone = (ContextMenuZone)instance); builder.CloseComponent(); } else @@ -1175,6 +1174,12 @@ private RenderFragment RenderTabList() => builder => } }; + private RenderFragment RenderContextMenuZoneContent() => builder => + { + builder.AddContent(0, RenderTabItems()); + builder.AddContent(10, RenderContextMenu); + }; + private RenderFragment RenderTabItems() => builder => { for (var index = 0; index < _items.Count; index++) From a69cff48bf6c3790887a14d2177bb73084461814 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 13:28:45 +0800 Subject: [PATCH 07/10] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.scss b/src/BootstrapBlazor/Components/Tab/Tab.razor.scss index f98299ada48..141d1142cae 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.scss +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.scss @@ -82,6 +82,11 @@ position: relative; display: flex; height: 100%; + + .bb-cm-zone { + display: flex; + flex-wrap: nowrap; + } } .tabs-nav-wrap { @@ -553,6 +558,7 @@ display: flex; align-items: center; border-radius: var(--bs-border-radius); + user-select: none; &:hover { background-color: var(--bb-tabs-item-hover-bg-color); From e67e05481a727f8c778a56da9961f2c78a22ef36 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 14:14:28 +0800 Subject: [PATCH 08/10] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20LayoutId?= =?UTF-8?q?=20=E8=8E=B7=E5=BE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Tab/Tab.razor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs index a392c131885..d47ba62b02d 100644 --- a/src/BootstrapBlazor/Components/Tab/Tab.razor.cs +++ b/src/BootstrapBlazor/Components/Tab/Tab.razor.cs @@ -580,7 +580,9 @@ protected override async Task OnAfterRenderAsync(bool firstRender) /// /// /// - protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, nameof(DragItemCallback), Layout?.Id); + protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, nameof(DragItemCallback), LayoutId); + + private string? LayoutId => Layout is { ShowTabInHeader: true } ? Layout.Id : null; private void RemoveLocationChanged() { From 8348871bd69a1b2b0685a09e6475106c885ec940 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 14:20:34 +0800 Subject: [PATCH 09/10] =?UTF-8?q?refactor:=20=E6=92=A4=E9=94=80=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Layout/Layout.razor.scss | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.scss b/src/BootstrapBlazor/Components/Layout/Layout.razor.scss index 334bced2613..1784445d252 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.scss +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.scss @@ -49,14 +49,6 @@ .layout-main { min-height: calc(var(--bb-layout-height) - var(--bb-layout-header-height) - var(--bb-layout-footer-height)); - - > .tabs, - > .bb-cm-zone > .tabs { - margin: -1rem; - border: none; - border-radius: unset; - min-height: calc(100% + 2rem); - } } } From 49dfb98bca9cbbdbba3824ce69ee3c80c7220df1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 2 Apr 2025 14:38:10 +0800 Subject: [PATCH 10/10] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/LayoutTest.cs | 2 +- test/UnitTest/Components/TabTest.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/UnitTest/Components/LayoutTest.cs b/test/UnitTest/Components/LayoutTest.cs index 16e98a8cd76..2c6e4e9a3b4 100644 --- a/test/UnitTest/Components/LayoutTest.cs +++ b/test/UnitTest/Components/LayoutTest.cs @@ -45,7 +45,7 @@ public async Task TabStyle_Ok() cut.SetParametersAndRender(pb => pb.Add(a => a.ShowFullscreenToolbarButton, false)); Assert.DoesNotContain("tabs-nav-toolbar-fs", cut.Markup); - cut.SetParametersAndRender(pb => pb.Add(a => a.ToolbarTemplate, builder => builder.AddContent(0, "test-toolbar-template"))); + cut.SetParametersAndRender(pb => pb.Add(a => a.ToolbarTemplate, tab => builder => builder.AddContent(0, "test-toolbar-template"))); Assert.Contains("test-toolbar-template", cut.Markup); cut.SetParametersAndRender(pb => pb.Add(a => a.ShowTabContextMenu, true)); diff --git a/test/UnitTest/Components/TabTest.cs b/test/UnitTest/Components/TabTest.cs index 3602fd93a3b..710ec6846b5 100644 --- a/test/UnitTest/Components/TabTest.cs +++ b/test/UnitTest/Components/TabTest.cs @@ -66,7 +66,7 @@ public void ToolbarTemplate_Ok() pb.Add(a => a.Icon, "fa-solid fa-font-awesome"); pb.Add(a => a.ChildContent, "Tab1-Content"); }); - pb.Add(a => a.ToolbarTemplate, builder => builder.AddContent(0, "test-toolbar-template")); + pb.Add(a => a.ToolbarTemplate, tab => builder => builder.AddContent(0, "test-toolbar-template")); }); cut.DoesNotContain("test-toolbar-template"); @@ -765,10 +765,10 @@ public void ButtonTemplate_Ok() var cut = Context.RenderComponent(pb => { pb.Add(a => a.ShowExtendButtons, true); - pb.Add(a => a.ButtonTemplate, new RenderFragment(builder => + pb.Add(a => a.ButtonTemplate, tab => builder => { builder.AddContent(0, new MarkupString("
test-button
")); - })); + }); }); cut.Contains("
test-button
"); } @@ -1034,8 +1034,8 @@ public void BeforeNavigatorTemplate_Ok() { pb.AddChildContent(pb => { - pb.Add(a => a.BeforeNavigatorTemplate, builder => builder.AddContent(0, "before-navigator-template")); - pb.Add(a => a.AfterNavigatorTemplate, builder => builder.AddContent(0, "after-navigator-template")); + pb.Add(a => a.BeforeNavigatorTemplate, tab => builder => builder.AddContent(0, "before-navigator-template")); + pb.Add(a => a.AfterNavigatorTemplate, tab => builder => builder.AddContent(0, "after-navigator-template")); pb.AddChildContent(pb => { pb.Add(a => a.ShowFullScreen, true);