This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
2019-10-22 12:52:34 -04:00

28 lines
612 B
Plaintext

@namespace Oqtane.Modules.Controls
@inherits ModuleBase
@if (Parent.ActiveTabPanel == (TabPanel)(object)this)
{
@ChildContent
}
@code {
[CascadingParameter]
private TabControl Parent { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
[Parameter]
public string Text { get; set; }
protected override void OnInitialized()
{
if (Parent == null)
throw new ArgumentNullException(nameof(Parent), "TabPanel must exist within a TabControl");
base.OnInitialized();
Parent.AddTabPanel((TabPanel)(object)this);
}
}