@for (int i = 0; i < WebReport.Tabs.Count; i++)
{
int copyIndex = i;
string active = (copyIndex == WebReport.CurrentTabIndex ? "active" : "");
}
@code {
[Parameter]
public WebReport WebReport { get; set; }
private void SetTab(int i)
{
if(i != WebReport.CurrentTabIndex)
{
WebReport.SetTab(i);
WebReport.OnUpdate(false);
}
}
private void CloseTab(int i)
{
var activeTab = WebReport.CurrentTab;
WebReport.Tabs[i].Report.Dispose();
WebReport.Tabs.RemoveAt(i);
if (activeTab == null)
{
WebReport.CurrentTabIndex = 0;
}
else
{
for (int j = 0; j < WebReport.Tabs.Count; j++)
if (WebReport.Tabs[j] == activeTab)
{
WebReport.CurrentTabIndex = j;
break;
}
}
WebReport.OnUpdate(false);
}
}