feature: search in ranking page

This commit is contained in:
2020-05-07 18:47:27 +08:00
parent 8249ba09ce
commit f6575f61e6
7 changed files with 117 additions and 46 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
@@ -17,6 +16,7 @@ namespace Pixiview.Illust
public interface IIllustCollectionPage
{
List<IllustItem> Favorites { get; }
IllustCollection IllustCollection { get; set; }
}
public abstract class IllustDataCollectionPage : IllustCollectionPage<IllustData> { }
@@ -61,6 +61,7 @@ namespace Pixiview.Illust
}
public List<IllustItem> Favorites { get; } = new List<IllustItem>();
public IllustCollection IllustCollection { get; set; }
protected virtual bool IsFavoriteVisible => true;
@@ -122,14 +123,7 @@ namespace Pixiview.Illust
columns = 2;
break;
case Orientation.PortraitUpsideDown:
if (DeviceInfo.Idiom == DeviceIdiom.Phone)
{
columns = 4;
}
else
{
columns = 2;
}
columns = isPhone ? 4 : 2;
break;
case Orientation.Unknown:
case Orientation.LandscapeLeft:
@@ -323,6 +317,7 @@ namespace Pixiview.Illust
item.IsFavorite = Favorites.Any(i => i.Id == item.Id);
}
}
IllustCollection = collection;
Illusts = collection;
Loading = false;
@@ -361,7 +356,7 @@ namespace Pixiview.Illust
#endregion
}
public class IllustCollection : ObservableCollection<IllustItem>
public class IllustCollection : List<IllustItem>
{
private static readonly object sync = new object();
private static IllustCollection empty;