42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Gallery.Util;
|
|
using Gallery.Util.Interface;
|
|
using Gallery.Util.Model;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Gallery.Sources
|
|
{
|
|
public class FavoriteGallerySource : GallerySourceBase
|
|
{
|
|
public override string Name => "Favorite";
|
|
public override string Route => Routes.Favorite;
|
|
public override string FlyoutIconKey => "Favorite";
|
|
public override string HomePage => null;
|
|
public override bool IsScrollable => false;
|
|
|
|
public override Task<IEnumerable<GalleryItem>> GetRecentItemsAsync(int page)
|
|
{
|
|
return Task.FromResult((IEnumerable<GalleryItem>)Store.FavoriteList);
|
|
}
|
|
|
|
public override void SetCookie()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void InitDynamicResources(string family, ResourceDictionary light, ResourceDictionary dark)
|
|
{
|
|
var icon = new FontImageSource
|
|
{
|
|
FontFamily = family,
|
|
Glyph = "\uf02e",
|
|
Size = 18.0
|
|
};
|
|
light.Add(FlyoutIconKey, icon);
|
|
dark.Add(FlyoutIconKey, icon);
|
|
}
|
|
}
|
|
}
|