public FolderListupPageViewModel(
            BookmarkManager bookmarkManager,
            ImageCollectionManager imageCollectionManager,
            SourceStorageItemsRepository sourceStorageItemsRepository,
            PathReferenceCountManager PathReferenceCountManager,
            SecondaryTileManager secondaryTileManager,
            FolderLastIntractItemManager folderLastIntractItemManager,
            FolderListingSettings folderListingSettings,
            OpenPageCommand openPageCommand,
            OpenFolderItemCommand openFolderItemCommand,
            OpenImageViewerCommand openImageViewerCommand,
            OpenFolderListupCommand openFolderListupCommand,
            OpenWithExplorerCommand openWithExplorerCommand,
            SecondaryTileAddCommand secondaryTileAddCommand,
            SecondaryTileRemoveCommand secondaryTileRemoveCommand
            )
        {
            _bookmarkManager              = bookmarkManager;
            _imageCollectionManager       = imageCollectionManager;
            _sourceStorageItemsRepository = sourceStorageItemsRepository;
            _PathReferenceCountManager    = PathReferenceCountManager;
            SecondaryTileManager          = secondaryTileManager;
            _folderLastIntractItemManager = folderLastIntractItemManager;
            _folderListingSettings        = folderListingSettings;
            OpenPageCommand            = openPageCommand;
            OpenFolderItemCommand      = openFolderItemCommand;
            OpenImageViewerCommand     = openImageViewerCommand;
            OpenFolderListupCommand    = openFolderListupCommand;
            OpenWithExplorerCommand    = openWithExplorerCommand;
            SecondaryTileAddCommand    = secondaryTileAddCommand;
            SecondaryTileRemoveCommand = secondaryTileRemoveCommand;
            FolderItems      = new ObservableCollection <StorageItemViewModel>();
            ArchiveFileItems = new ObservableCollection <StorageItemViewModel>();
            EBookFileItems   = new ObservableCollection <StorageItemViewModel>();
            ImageFileItems   = new ObservableCollection <StorageItemViewModel>();

            FileItemsView        = new AdvancedCollectionView(ImageFileItems);
            SelectedFileSortType = new ReactivePropertySlim <FileSortType>(FileSortType.TitleAscending);



            FileDisplayMode       = _folderListingSettings.ToReactivePropertyAsSynchronized(x => x.FileDisplayMode);
            FolderLastIntractItem = new ReactivePropertySlim <StorageItemViewModel>();
            ImageLastIntractItem  = new ReactivePropertySlim <int>();

            /*
             * _currentQueryOptions = Observable.CombineLatest(
             *  SelectedFolderViewFirstSort,
             *  (queryType, sort) => (queryType, sort)
             *  )
             *  .Select(_ =>
             *  {
             *      var options = new QueryOptions();
             *      options.FolderDepth = FolderDepth.Shallow;
             *      options.SetPropertyPrefetch(Windows.Storage.FileProperties.PropertyPrefetchOptions.ImageProperties, Enumerable.Empty<string>());
             *      return options;
             *  })
             *  .ToReadOnlyReactivePropertySlim();
             */
        }
        public PrimaryWindowCoreLayoutViewModel(
            [Dependency("PrimaryWindowNavigationService")] Lazy <INavigationService> navigationServiceLazy,
            IEventAggregator eventAggregator,
            IScheduler scheduler,
            ApplicationSettings applicationSettings,
            RestoreNavigationManager restoreNavigationManager,
            SourceStorageItemsRepository sourceStorageItemsRepository,
            PathReferenceCountManager PathReferenceCountManager,
            FolderContainerTypeManager folderContainerTypeManager,
            StorageItemSearchManager storageItemSearchManager,
            SourceChoiceCommand sourceChoiceCommand,
            RefreshNavigationCommand refreshNavigationCommand,
            OpenPageCommand openPageCommand
            )
        {
            MenuItems = new List <object>
            {
                new MenuItemViewModel()
                {
                    PageType = nameof(Views.SourceStorageItemsPage)
                },
                //new MenuItemViewModel() { PageType = nameof(Views.CollectionPage) },
            };
            _navigationServiceLazy              = navigationServiceLazy;
            EventAggregator                     = eventAggregator;
            _scheduler                          = scheduler;
            ApplicationSettings                 = applicationSettings;
            RestoreNavigationManager            = restoreNavigationManager;
            SourceStorageItemsRepository        = sourceStorageItemsRepository;
            _PathReferenceCountManager          = PathReferenceCountManager;
            _folderContainerTypeManager         = folderContainerTypeManager;
            _storageItemSearchManager           = storageItemSearchManager;
            SourceChoiceCommand                 = sourceChoiceCommand;
            SourceChoiceCommand.OpenAfterChoice = true;
            RefreshNavigationCommand            = refreshNavigationCommand;
            OpenPageCommand                     = openPageCommand;


            UpdateAutoSuggestCommand = new ReactiveCommand <string>();

            UpdateAutoSuggestCommand
            .Throttle(TimeSpan.FromSeconds(0.250), _scheduler)
            .Subscribe(ExecuteUpdateAutoSuggestCommand)
            .AddTo(_disposables);

            EventAggregator.GetEvent <PathReferenceCountUpdateWhenSourceManagementChanged.SearchIndexUpdateProgressEvent>()
            .Subscribe(args =>
            {
                _autoSuggestBoxSearchIndexGroup.SearchIndexUpdateProgressCount = args.ProcessedCount;
                _autoSuggestBoxSearchIndexGroup.SearchIndexUpdateTotalCount    = args.TotalCount;

                Debug.WriteLine($"[SearchIndexUpdate] progress: {args.ProcessedCount}/{args.TotalCount} ");
            }
                       , ThreadOption.UIThread
                       , keepSubscriberReferenceAlive: true
                       )
            .AddTo(_disposables);

            AutoSuggestBoxItems = new[]
            {
                _AutoSuggestItemsGroup,
                _autoSuggestBoxSearchIndexGroup
            };
        }