private void OnRequestNavigateFromUrl(object sender, RequestNavigateEventArgs e)
        {
            ILink link = _session.FromLink(e.Uri.OriginalString);

            if (link != null)
            {
                if (link is ILink<IArtist>)
                {
                    IArtist artist = ((ILink<IArtist>)link).Object;
                    Artist torshifyArtist = new Artist(artist, Application.Current.Dispatcher);
                    CoreCommands.Views.GoToArtistCommand.Execute(torshifyArtist);
                }
                else if (link is ILink<IAlbum>)
                {
                    IAlbum album = ((ILink<IAlbum>)link).Object;
                    Album torshifyAlbum = new Album(album, Application.Current.Dispatcher);
                    CoreCommands.Views.GoToAlbumCommand.Execute(torshifyAlbum);
                }
                else if (link is ILink<ITrackAndOffset>)
                {
                    ITrackAndOffset track = ((ILink<ITrackAndOffset>) link).Object;
                    Track torshifyTrack = new Track(track.Track, Application.Current.Dispatcher);
                    CoreCommands.PlayTrackCommand.Execute(torshifyTrack);
                    CoreCommands.Player.SeekCommand.Execute(track.Offset);
                }
            }
        }
 public ArtistInformation(Artist artist, Dispatcher dispatcher)
 {
     _portraits = new NotifyCollection<Image>();
     _tracks = new NotifyCollection<Track>();
     _albums = new NotifyCollection<Album>();
     _similarArtists = new NotifyCollection<Artist>();
     _dispatcher = dispatcher;
     _artist = artist;
     _browse = _artist.InternalArtist.Browse();
     _isLoading = !_browse.IsComplete;
     _browse.Completed += ArtistBrowseCompleted;
 }
        public AlbumInformation(Artist originalArtist, Album album, Dispatcher dispatcher)
        {
            _orginalArtist = originalArtist;
            _tracks = new NotifyCollection<Track>();
            _copyrights = new NotifyCollection<string>();
            _dispatcher = dispatcher;
            _album = album;
            _browse = _album.InternalAlbum.Browse();
            _isLoading = !_browse.IsComplete;

            if (IsLoading)
            {
                _browse.Completed += AlbumBrowseCompleted;
            }
            else
            {
                AlbumBrowseCompleted(_browse, null);
            }
        }
Exemple #4
0
 public Album(Artist originalArtist, IAlbum album, Dispatcher dispatcher)
     : this(album, dispatcher)
 {
     _originalArtist = originalArtist;
 }