2026-10-03 12:01:42 +02:00
|
|
|
@implements IDisposable
|
|
|
|
|
|
|
|
|
|
@* One tab of a DTabs: renders nothing itself; DTabs renders its Header as the tab button and its ChildContent as
|
|
|
|
|
the panel while it is active. *@
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[CascadingParameter] DTabs Parent { get; set; }
|
|
|
|
|
[Parameter] public RenderFragment Header { get; set; }
|
|
|
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
|
|
|
[Parameter] public bool Disabled { get; set; }
|
|
|
|
|
[Parameter] public string Class { get; set; }
|
2026-10-06 23:31:07 +02:00
|
|
|
/// <summary>The tab's name for a screen reader and as its tooltip, when its Header shows only an icon.</summary>
|
|
|
|
|
[Parameter] public string AccessibleName { get; set; }
|
2026-10-03 12:01:42 +02:00
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
if (Parent is null)
|
|
|
|
|
throw new InvalidOperationException($"{nameof(DTab)} must be inside a {nameof(DTabs)}.");
|
|
|
|
|
Parent.Add(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose() => Parent?.Remove(this);
|
|
|
|
|
}
|