SharpRSS/WebSharpRSS/Shared/SideGuide.razor

41 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-04-28 21:58:36 +02:00
@using WebSharpRSS.Models
@using MudBlazor.Utilities
<MudList DisableGutters="true">
<MudListItem>
<MudNavMenu>
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
</MudNavMenu>
</MudListItem>
<MudDivider/>
<MudListItem>
<MudTreeView Items="Categories" Hover="true" ExpandOnClick="true" @bind-SelectedValue="SelectedItem">
<ItemTemplate>
<MudTreeViewItem @bind-Expanded="@context.IsExpanded" Icon="@context.CategoryIcon" Text="@context.CategoryTitle" Value="@context">
<ChildContent>
<MudTable Items="@context.Feeds">
<RowTemplate Context="feedContext">
<MudTd>
<MudText>@feedContext.Title</MudText>
</MudTd>
</RowTemplate>
</MudTable>
</ChildContent>
</MudTreeViewItem>
</ItemTemplate>
</MudTreeView>
</MudListItem>
</MudList>
@code {
public HashSet<CategoryTreeItem> Categories = new HashSet<CategoryTreeItem>();
protected override void OnInitialized()
{
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Test cat.", CategoryIcon = Icons.Material.Filled.RssFeed });
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Blogs", CategoryIcon = Icons.Material.Filled.RssFeed });
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Tech", CategoryIcon = Icons.Material.Filled.Computer });
Categories.Add(new CategoryTreeItem() { CategoryTitle = "News", CategoryIcon = Icons.Material.Filled.Newspaper });
}
CategoryTreeItem SelectedItem { get; set; }
}