diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor
index 0feb28735..877d97d26 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor
@@ -1,30 +1,34 @@
This is the placeholder content for the Home tab. This is the placeholder content for the Profile tab. This is the placeholder content for the Contact tab.
Current Active Tab: @activeTabTitle
-Previous Active Tab: @previousActiveTabTitle
+Current Active Tab Name: @activeTabName
+Current Active Tab Title: @activeTabTitle
+Previous Active Tab Name: @previousActiveTabName
+Previous Active Tab Title: @previousActiveTabTitle
@code { + private string? activeTabName; private string? activeTabTitle; + private string? previousActiveTabName; private string? previousActiveTabTitle; private void OnTabShowingAsync(TabsEventArgs args) @@ -35,7 +39,9 @@ OnShowing="@(args => OnTabShowingAsync(args))" private void OnTabShownAsync(TabsEventArgs args) { + activeTabName = args.ActiveTabName; activeTabTitle = args.ActiveTabTitle; + previousActiveTabName = args.PreviousActiveTabName; previousActiveTabTitle = args.PreviousActiveTabTitle; } diff --git a/blazorbootstrap/Components/Tabs/Tabs.razor.cs b/blazorbootstrap/Components/Tabs/Tabs.razor.cs index f64d9137d..f19354983 100644 --- a/blazorbootstrap/Components/Tabs/Tabs.razor.cs +++ b/blazorbootstrap/Components/Tabs/Tabs.razor.cs @@ -69,43 +69,49 @@ protected override async Task OnInitializedAsync() [JSInvokable] public async Task bsHiddenTab(string activeTabId, string previousActiveTabId) { - var activeTabTitle = tabs?.FirstOrDefault(x => x.Id == activeTabId)?.Title; - var previousActiveTabTitle = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId)?.Title; + var activeTab = tabs?.FirstOrDefault(x => x.Id == activeTabId); + var previousActiveTab = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId); - var args = new TabsEventArgs(activeTabTitle!, previousActiveTabTitle!); + var args = new TabsEventArgs(activeTab?.Name!, activeTab?.Title!, previousActiveTab?.Name!, previousActiveTab?.Title!); await OnHidden.InvokeAsync(args); } [JSInvokable] public async Task bsHideTab(string activeTabId, string previousActiveTabId) { - var activeTabTitle = tabs?.FirstOrDefault(x => x.Id == activeTabId)?.Title; - var previousActiveTabTitle = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId)?.Title; + var activeTab = tabs?.FirstOrDefault(x => x.Id == activeTabId); + var previousActiveTab = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId); - var args = new TabsEventArgs(activeTabTitle!, previousActiveTabTitle!); + var args = new TabsEventArgs(activeTab?.Name!, activeTab?.Title!, previousActiveTab?.Name!, previousActiveTab?.Title!); await OnHiding.InvokeAsync(args); } [JSInvokable] public async Task bsShownTab(string activeTabId, string previousActiveTabId) { - var activeTabTitle = tabs?.FirstOrDefault(x => x.Id == activeTabId)?.Title; - var previousActiveTabTitle = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId)?.Title; + var activeTab = tabs?.FirstOrDefault(x => x.Id == activeTabId); + var previousActiveTab = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId); - var args = new TabsEventArgs(activeTabTitle!, previousActiveTabTitle!); + var args = new TabsEventArgs(activeTab?.Name!, activeTab?.Title!, previousActiveTab?.Name!, previousActiveTab?.Title!); await OnShown.InvokeAsync(args); } [JSInvokable] public async Task bsShowTab(string activeTabId, string previousActiveTabId) { - var activeTabTitle = tabs?.FirstOrDefault(x => x.Id == activeTabId)?.Title; - var previousActiveTabTitle = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId)?.Title; + var activeTab = tabs?.FirstOrDefault(x => x.Id == activeTabId); + var previousActiveTab = tabs?.FirstOrDefault(x => x.Id == previousActiveTabId); - var args = new TabsEventArgs(activeTabTitle!, previousActiveTabTitle!); + var args = new TabsEventArgs(activeTab?.Name!, activeTab?.Title!, previousActiveTab?.Name!, previousActiveTab?.Title!); await OnShowing.InvokeAsync(args); } + ///