private void CreateArtistBand(Track track) { if (track.Artists == null) return; ArtistsM = new TextBlock { FontWeight = FontWeights.Black, FontSize = 14, FontStretch = FontStretches.UltraExpanded, Foreground = Brushes.LightGray }; ArtistsP = new TextBlock { FontWeight = FontWeights.Black, FontSize = 14, FontStretch = FontStretches.UltraExpanded, Foreground = Brushes.LightGray }; ArtistsV = new TextBlock { FontWeight = FontWeights.Black, FontSize = 14, FontStretch = FontStretches.UltraExpanded, Foreground = Brushes.LightGray }; var tmp = track.Artists.Last(); foreach (var artist in track.Artists) { ArtistsM.Inlines.Add(new Hyperlink { Command = new UiCommand(o => { Dispatch("Loader: Call(My Musics)"); Dispatch("AudioLibrary: View Artist", artist); }), Foreground = Brushes.LightGray, TextDecorations = null, Inlines = { artist.Name } }); if (artist != tmp) ArtistsM.Inlines.Add(", "); ArtistsP.Inlines.Add(new Hyperlink { Command = new UiCommand(o => { Dispatch("Loader: Call(My Musics)"); Dispatch("AudioLibrary: View Artist", artist); }), Foreground = Brushes.LightGray, TextDecorations = null, Inlines = { artist.Name } }); if (artist != tmp) ArtistsP.Inlines.Add(", "); ArtistsV.Inlines.Add(new Hyperlink { Command = new UiCommand(o => { Dispatch("Loader: Call(My Musics)"); Dispatch("AudioLibrary: View Artist", artist); }), Foreground = Brushes.LightGray, TextDecorations = null, Inlines = { artist.Name } }); if (artist != tmp) ArtistsV.Inlines.Add(", "); } OnPropertyChanged(nameof(ArtistsM)); OnPropertyChanged(nameof(ArtistsP)); OnPropertyChanged(nameof(ArtistsV)); }
public void AssignMedia(object media) { Track track = media as Track; _track = track; Music.Source = new Uri(track.Path); ForceSetPosition(0); AlbumCover = track.Album?.Cover; if (_track.Artists.Count > 0) CreateArtistBand(track); MediaName = track.Name; _tick.Tick -= OnTick; _tick.Tick += OnTick; AccessAlbum = new UiCommand(o => { Dispatch("Loader: Call(My Musics)"); Dispatch("AudioLibrary: View Album", track.Album); }); }