You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
655 B
32 lines
655 B
@using BlazorSample.UIInterfaces
|
|
@implements ITab
|
|
|
|
<li>
|
|
<a @onclick="ActivateTab" class="nav-link @TitleCssClass" role="button">
|
|
@Title
|
|
</a>
|
|
</li>
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
public TabSet ContainerTabSet { get; set; }
|
|
|
|
[Parameter]
|
|
public string Title { get; set; }
|
|
|
|
[Parameter]
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
private string TitleCssClass =>
|
|
ContainerTabSet.ActiveTab == this ? "active" : null;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
ContainerTabSet.AddTab(this);
|
|
}
|
|
|
|
private void ActivateTab()
|
|
{
|
|
ContainerTabSet.SetActiveTab(this);
|
|
}
|
|
} |