using System;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using StrixMusic.Sdk.ViewModels;
using StrixMusic.Sdk.WinUI.Controls.Items;
using StrixMusic.Shells.Groove.Messages.Navigation.Pages;
namespace StrixMusic.Shells.Groove.Controls.Items
{
///
public class GrooveArtistItem : ArtistItem
{
///
public GrooveArtistItem()
{
this.DefaultStyleKey = typeof(GrooveArtistItem);
NavigateToArtistCommand = new RelayCommand(new Action(NavigateToArtist));
}
///
/// A command that triggers navigation to the provided artist.
///
public RelayCommand NavigateToArtistCommand { get; private set; }
private void NavigateToArtist(ArtistViewModel? viewModel)
{
if (viewModel != null)
WeakReferenceMessenger.Default.Send(new ArtistViewNavigationRequestMessage(viewModel));
}
}
}