mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-11-10 07:54:20 +01:00
41 lines
1.8 KiB
Plaintext
41 lines
1.8 KiB
Plaintext
|
@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; }
|
||
|
}
|