blob: 0dc192452ca11fe2f3b4c1368e5e6d3d340f1651 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/>
<div class="tabs">
@foreach(var pane in Panes) {
<a href="javascript:;" @onclick=@(() => ActivePane = pane) class="@(pane == ActivePane ? "selected" : "")">
@pane.Title
</a>
}
</div>
<CascadingValue Value="this">
@ChildContent
</CascadingValue>
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }
public TabPane ActivePane { get; set; }
List<TabPane> Panes = new();
public void AddPane(TabPane tabPane) {
Panes.Add(tabPane);
if(Panes.Count == 1)
ActivePane = tabPane;
StateHasChanged();
}
}
|