added logging and minor cleanup

This commit is contained in:
Shaun Walker
2019-10-22 12:49:04 -04:00
parent 88aee61ddf
commit 4d5cc262ef
3 changed files with 45 additions and 25 deletions

View File

@ -0,0 +1,27 @@
@namespace Oqtane.Modules.Controls
@inherits ThemeControlBase
@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);
}
}