SharpRSS/WebSharpRSS/Shared/SideGuide.razor

45 lines
1.2 KiB
Plaintext

@using SharpRss.Models;
@using MudBlazor.Utilities
@using CodeHollow.FeedReader
@using Serilog
@using WebSharpRSS.Models;
@inject RssService _rssService
<MudStack Spacing="2">
<MudNavMenu>
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
</MudNavMenu>
<CategoryGuide GuideItems="Categories" CatItemClicked="CategoryClicked" FeedItemClicked="FeedClicked"/>
</MudStack>
@code {
public HashSet<GuideItemModel> Categories = new HashSet<GuideItemModel>();
protected override async void OnInitialized()
{
Log.Verbose("Setting up test data");
//Categories = _rssService.GetCategories().Result;
HashSet<CategoryModel> cats = await _rssService.GetCategories();
await Task.Run(() => Categories = cats.Select(x => new GuideItemModel(x)).ToHashSet());
}
private void Callback(MudListItem obj)
{
switch (obj.Value)
{
case CategoryModel catModel:
break;
case FeedModel feedModel:
break;
}
}
private void CategoryClicked(CategoryModel cat)
{
}
private void FeedClicked(FeedModel guideFeedItem)
{
}
}