@if(Parent.ActivePane == this) { @ChildContent } @code { [CascadingParameter] private TabContainer Parent { get; set; } [Parameter] public string Title { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } protected override void OnInitialized() { if (Parent is null) throw new ArgumentNullException(nameof(Parent), "TabPane must exist within a TabContainer"); Parent.AddPane(this); } }