Ejemplo n.º 1
0
        public async Task OnNavigatedFrom()
        {
            ResetLibrary();

            switch (_musicView)
            {
            case MusicView.Albums:
                if (Locator.MediaLibrary.Albums != null)
                {
                    Locator.MediaLibrary.Albums.CollectionChanged -= Albums_CollectionChanged;
                    Locator.MediaLibrary.Albums.Clear();
                }

                RecommendedAlbums?.Clear();

                await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, () =>
                {
                    GroupedAlbums      = null;
                    LoadingStateAlbums = LoadingState.NotLoaded;
                });

                break;

            case MusicView.Artists:
                if (Locator.MediaLibrary.Artists != null)
                {
                    Locator.MediaLibrary.Artists.CollectionChanged -= Artists_CollectionChanged;
                    Locator.MediaLibrary.Artists.Clear();
                }

                await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, () =>
                {
                    GroupedArtists      = null;
                    LoadingStateArtists = LoadingState.NotLoaded;
                });

                break;

            case MusicView.Songs:
                if (Locator.MediaLibrary.Tracks != null)
                {
                    Locator.MediaLibrary.Tracks.CollectionChanged -= Tracks_CollectionChanged;
                    Locator.MediaLibrary.Tracks.Clear();
                }

                await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, () =>
                {
                    GroupedTracks      = null;
                    LoadingStateTracks = LoadingState.NotLoaded;
                });

                break;

            case MusicView.Playlists:
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        public void ResetLibrary()
        {
            LoadingStateAlbums    = LoadingState.NotLoaded;
            LoadingStateArtists   = LoadingState.NotLoaded;
            LoadingStateTracks    = LoadingState.NotLoaded;
            LoadingStatePlaylists = LoadingState.NotLoaded;

            RecommendedAlbums?.Clear();
        }
Ejemplo n.º 3
0
        public void ResetLibrary()
        {
            LoadingStateAlbums    = LoadingState.NotLoaded;
            LoadingStateArtists   = LoadingState.NotLoaded;
            LoadingStateTracks    = LoadingState.NotLoaded;
            LoadingStatePlaylists = LoadingState.NotLoaded;

            RecommendedArtists?.Clear();
            RecommendedArtists = new ObservableCollection <ArtistItem>();

            RecommendedAlbums?.Clear();
            RecommendedAlbums = new List <AlbumItem>();
        }
Ejemplo n.º 4
0
        public Task OnNavigatedFromAlbums()
        {
            if (Locator.MediaLibrary.Albums != null)
            {
                Locator.MediaLibrary.Albums.CollectionChanged -= Albums_CollectionChanged;
                Locator.MediaLibrary.Albums.Clear();
            }

            RecommendedAlbums?.Clear();

            return(DispatchHelper.InvokeAsync(CoreDispatcherPriority.Low, () =>
            {
                GroupedAlbums = null;
                LoadingStateAlbums = LoadingState.NotLoaded;
            }));
        }