-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.razor
41 lines (38 loc) · 1.2 KB
/
Index.razor
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
29
30
31
32
33
34
35
36
37
38
39
40
41
@page "/"
<DxTabs>
@foreach(var tab in TabList) {
<DxTabPage @key="@tab">
<TextTemplate>
<div>
@tab
<DxButton IconCssClass="oi oi-circle-x"
RenderStyle="ButtonRenderStyle.Link"
RenderStyleMode="ButtonRenderStyleMode.Text"
CssClass="shadow-none remove-padding"
Click="() => RemoveTab(tab)" />
</div>
</TextTemplate>
<ChildContent>
<div class="p-1">
The <b>@tab</b> tab's content
</div>
</ChildContent>
</DxTabPage>
}
</DxTabs>
<DxButton Click="AddTab">Add Tab</DxButton>
<DxButton Click="RestoreTabs">Restore Tabs</DxButton>
@code {
List<string> TabList = new List<string> { "Required Information", "Additional Information" };
void RemoveTab(string tab) {
TabList.Remove(tab);
}
void AddTab() {
TabList.Add("New Tab");
}
void RestoreTabs() {
TabList.Clear();
TabList.Add("Required Information");
TabList.Add("Additional Information");
}
}