Example #1
0
        public async void LoadIndexesAsync(ISonicCache cache)
        {
            var x = new MusicFolders(cache);
            await LoadIndexesOperation.RunAsync(() => x.GetAsync(SourcePolicy.Cache), e => { });


            Indexes.StableMergeUpdate(x.Folders.First().Indexes);
        }
Example #2
0
        public IndexesViewModel(ISonicCache cache)
        {
            LoadIndexesOperation = new LongRunningOperation();

            LoadIndexesAsync(cache);

            RefreshCommand = new RelayCommand(async () =>
                {
                    ArbitraryContainer.Default.Resolve<INavigationService>().ClearPageCache();

                    var x = new MusicFolders(cache);
                    await x.GetAsync(SourcePolicy.Refresh);

                    Indexes.StableMergeUpdate(x.Folders.First().Indexes);
                });

            DirectoryClickedCommand = new RelayCommand<MusicDirectory>(
                x => ArbitraryContainer.Default.Resolve<INavigationService>().Navigate(typeof(MusicDirectoryView), x));
        }