You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Components/Tabs/DynamicTabs.razor

45 lines
1.1 KiB

2 years ago
@namespace Connected.Components
@inherits Tabs
@{
base.BuildRenderTree(__builder);
}
@code {
protected override void OnInitialized()
{
base.Header = (context) =>
@:@{
if (string.IsNullOrEmpty(AddIconToolTip) == false)
{
<Tooltip Text="@AddIconToolTip">
<IconButton Icon="@AddTabIcon" Class="@AddIconClass" Style="@AddIconStyle" OnClick="@AddTab" />
</Tooltip>
}
else
{
<IconButton Icon="@AddTabIcon" Class="@AddIconClass" Style="@AddIconStyle" OnClick="@AddTab" />
}
}
;
base.TabPanelHeader = (context) =>
@:@{
if (string.IsNullOrEmpty(CloseIconToolTip) == false)
{
<Tooltip Text="@CloseIconToolTip">
<IconButton Icon="@CloseTabIcon" Class="@CloseIconClass" Style="@CloseIconStyle" OnClick="EventCallback.Factory.Create<MouseEventArgs>(this, () => CloseTab.InvokeAsync(context))" />
</Tooltip>
}
else
{
<IconButton Icon="@CloseTabIcon" Class="@CloseIconClass" Style="@CloseIconStyle" OnClick="EventCallback.Factory.Create<MouseEventArgs>(this, () => CloseTab.InvokeAsync(context))" />
}
}
;
}
}