using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using OwlCore.Extensions;
using StrixMusic.Sdk.ViewModels;
using StrixMusic.Shells.Groove.Messages.Navigation.Pages;
using StrixMusic.Shells.Groove.ViewModels.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace StrixMusic.Shells.Groove.Controls.Collections
{
///
/// A for displaying s in the Groove Shell.
///
public partial class GrooveArtistCollection : Control
{
///
/// Initializes a new instance of the class.
///
public GrooveArtistCollection()
{
DefaultStyleKey = typeof(GrooveArtistCollection);
NavigateToArtistCommand = new RelayCommand(NavigateToArtist);
}
///
/// The backing dependency property for .F
///
public static readonly DependencyProperty ArtistCollectionProperty =
DependencyProperty.Register(nameof(ArtistCollection), typeof(IArtistCollectionViewModel), typeof(GrooveArtistCollection), new PropertyMetadata(null, (d, e) => d.Cast().OnArtistCollectionChanged()));
///
/// The artist collection to display.
///
public IArtistCollectionViewModel ArtistCollection
{
get { return (IArtistCollectionViewModel)GetValue(ArtistCollectionProperty); }
set { SetValue(ArtistCollectionProperty, value); }
}
///
/// A Command that requests a navigation to an artist page.
///
public RelayCommand NavigateToArtistCommand { get; private set; }
private void NavigateToArtist(ArtistViewModel? viewModel)
{
if (viewModel != null)
WeakReferenceMessenger.Default.Send(new ArtistViewNavigationRequestMessage(viewModel));
}
private void OnArtistCollectionChanged()
{
}
}
}