mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
32 lines
618 B
Plaintext
32 lines
618 B
Plaintext
@if (IsActive)
|
|
{
|
|
<div class="tab-pane fade show active">
|
|
@ChildContent
|
|
</div>
|
|
}
|
|
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
public required TabControl Parent { get; init; }
|
|
|
|
[Parameter]
|
|
public RenderFragment? ChildContent { get; set; }
|
|
|
|
[Parameter]
|
|
[EditorRequired]
|
|
public required string Name { get; set; }
|
|
|
|
private bool IsActive => Parent.ActiveTab == Name;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
if (Parent is null)
|
|
{
|
|
throw new Exception("TabContent must be contained in a TabControl.");
|
|
}
|
|
|
|
base.OnInitialized();
|
|
}
|
|
}
|