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);
                }
            }
        }
Exemplo n.º 2
0
        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);
            }
        }