mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 21:04:21 +01:00
Implementing 'GuideItem' class
This commit is contained in:
parent
87f46e2178
commit
ff1185729b
40
WebSharpRSS/Models/GuideItem.cs
Normal file
40
WebSharpRSS/Models/GuideItem.cs
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using CodeHollow.FeedReader;
|
||||||
|
using SharpRss.Models;
|
||||||
|
|
||||||
|
namespace WebSharpRSS.Models
|
||||||
|
{
|
||||||
|
public class GuideItem
|
||||||
|
{
|
||||||
|
public GuideItem(CategoryModel catModel)
|
||||||
|
{
|
||||||
|
_categoryModel = catModel;
|
||||||
|
Feeds = _categoryModel.Feeds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuideItem(FeedModel feedModel)
|
||||||
|
{
|
||||||
|
_feedModel = feedModel;
|
||||||
|
Feed = _feedModel.Base;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly CategoryModel? _categoryModel;
|
||||||
|
private readonly FeedModel? _feedModel;
|
||||||
|
|
||||||
|
public string Title { get; set; }
|
||||||
|
public bool IsSelected { get; set; }
|
||||||
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
// Category
|
||||||
|
public bool IsExpanded { get; set; }
|
||||||
|
public HashSet<FeedModel>? Feeds { get; set; }
|
||||||
|
// Feed
|
||||||
|
public Feed? Feed { get; set; }
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
public async void ItemClick()
|
||||||
|
{
|
||||||
|
IsExpanded = !IsExpanded;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Core" />
|
<Folder Include="Core" />
|
||||||
<Folder Include="Models" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user