示例#1
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            Tracks  = Tracks ?? new SimpleStateSupportCollection <JumpListGroup <VKSaverTrack> >(LoadTracks);
            Artists = Artists ?? new SimpleStateSupportCollection <JumpListGroup <VKSaverArtist> >(LoadArtists);
            Albums  = Albums ?? new SimpleStateSupportCollection <JumpListGroup <VKSaverAlbum> >(LoadAlbums);
            Genres  = Genres ?? new SimpleStateSupportCollection <JumpListGroup <VKSaverGenre> >(LoadGenres);
            Folders = Folders ?? new SimpleStateSupportCollection <VKSaverFolder>(LoadFolders);
            Cached  = Cached ?? new SimpleStateSupportCollection <JumpListGroup <VKSaverTrack> >(LoadCachedTracks);

            if (_libraryDatabaseService.NeedReloadLibraryView)
            {
                Tracks.Clear();
                Artists.Clear();
                Albums.Clear();
                Genres.Clear();
                Folders.Clear();
                Cached.Clear();

                _libraryDatabaseService.NeedReloadLibraryView = false;
            }

            if (viewModelState.Count > 0)
            {
                CurrentPivotIndex = (int)viewModelState[nameof(CurrentPivotIndex)];
            }
            else
            {
                string viewName = (string)e.Parameter;
                SetPivotIndex(viewName);
            }

            base.OnNavigatedTo(e, viewModelState);
        }
示例#2
0
 /// <summary>
 /// refresh data will clear cached data
 /// </summary>
 public void RefreshData()
 {
     //dont really see many reason to call this often
     //bc RecordCount & LasPage is updated every time a new page is request
     Cached.Clear();
     IsInnitalized = true;
     GetPage(1);
 }
        public void Value_WhenReadAfterClear_ReturnsExpectedValue()
        {
            var c     = new Cached <string>(Generator);
            var prior = c.Value;

            c.Clear();
            var current = c.Value;

            current.Should().Be("result#2");
            current.Should().NotBe(prior);
        }
示例#4
0
 public void Clear()
 {
     _cache.Clear();
 }
示例#5
0
 /// <summary>
 /// Add middleware into the processing of the store
 /// </summary>
 /// <remarks>
 /// Middleware is activated in the order added to the store.
 /// </remarks>
 /// <param name="middleware">
 /// The middleware processor to be included in the pipeline of the store.
 /// </param>
 public void AddMiddleware(IReduxMiddleware middleware)
 {
     _middleware.Add(middleware);
     _processingQueue.Clear();
 }