// Copyright (c) Arlo Godfrey. All Rights Reserved. // Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms. // See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information. using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Input; using OwlCore.Provisos; using StrixMusic.Sdk.AppModels; using StrixMusic.Sdk.BaseModels; namespace StrixMusic.Sdk.ViewModels { /// /// An interfaced ViewModel for . /// This is needed so because multiple view models implement , /// and the UI needs to create controls that handle only the ViewModels properties for an . /// public interface IArtistCollectionViewModel : ISdkViewModel, IArtistCollection, IPlayableCollectionViewModel, IImageCollectionViewModel, IUrlCollectionViewModel, IAsyncInit { /// /// The artist items in this collection. /// public ObservableCollection Artists { get; } /// /// Keeps the default artists collection while sorting. /// public ObservableCollection UnsortedArtists { get; } /// /// Sorts the artist collection by . /// /// The by which to sort. /// The direction by which to sort. public void SortArtistCollection(ArtistSortingType artistSorting, SortDirection sortDirection); /// /// Populates the next set of artists into the collection. /// /// A cancellation token that may be used to cancel the ongoing task. /// The number of items to load. /// A representing the asynchronous operation. public Task PopulateMoreArtistsAsync(int limit, CancellationToken cancellationToken = default); /// /// The sorting direction of artists in the collection. /// public ArtistSortingType CurrentArtistSortingType { get; } /// /// The sorting direction of artists in the collection. /// public SortDirection CurrentArtistSortingDirection { get; } /// /// Loads the entire collection of s and ensures all sources are merged. /// /// A representing the asynchronous operation. public Task InitArtistCollectionAsync(CancellationToken cancellationToken = default); /// /// Initializes the list of the . /// public IAsyncRelayCommand InitArtistCollectionAsyncCommand { get; } /// /// /// public IAsyncRelayCommand PopulateMoreArtistsCommand { get; } /// /// /// public IAsyncRelayCommand PlayArtistCollectionAsyncCommand { get; } /// /// Plays a single artist from this artist collection. /// public IAsyncRelayCommand PlayArtistAsyncCommand { get; } /// /// /// public IAsyncRelayCommand PauseArtistCollectionAsyncCommand { get; } /// /// Sorts the collection with a new type. /// public IRelayCommand ChangeArtistCollectionSortingTypeCommand { get; } /// /// Sorts the collection with a new direction. /// public IRelayCommand ChangeArtistCollectionSortingDirectionCommand { get; } } }