Example #1
0
 private void NewTab()
 {
     if (IsNewTabButtonVisible)
     {
         SearchTabViewModel searchTabViewModel = new SearchTabViewModel(mainModel, CurrentWindowContext);
         searchTabViewModel.NonFictionSearchComplete += SearchTabNonFictionSearchComplete;
         searchTabViewModel.FictionSearchComplete    += SearchTabFictionSearchComplete;
         searchTabViewModel.SciMagSearchComplete     += SearchTabSciMagSearchComplete;
         TabViewModels.Add(searchTabViewModel);
         SelectedTabViewModel = searchTabViewModel;
         NotifyPropertyChanged(nameof(IsNewTabButtonVisible));
     }
 }
Example #2
0
 private void ShowSearchResults(SearchTabViewModel searchTabViewModel, TabViewModel searchResultsTabViewModel)
 {
     if (searchTabViewModel != DefaultSearchTabViewModel)
     {
         searchTabViewModel.NonFictionSearchComplete -= SearchTabNonFictionSearchComplete;
         searchTabViewModel.FictionSearchComplete    -= SearchTabFictionSearchComplete;
         searchTabViewModel.SciMagSearchComplete     -= SearchTabSciMagSearchComplete;
         TabViewModels.Remove(searchTabViewModel);
     }
     TabViewModels.Add(searchResultsTabViewModel);
     SelectedTabViewModel = searchResultsTabViewModel;
     NotifyPropertyChanged(nameof(IsDefaultSearchTabVisible));
     NotifyPropertyChanged(nameof(AreTabsVisible));
     NotifyPropertyChanged(nameof(IsNewTabButtonVisible));
 }
Example #3
0
 public MainWindowViewModel(MainModel mainModel)
 {
     this.mainModel            = mainModel;
     defaultSearchTabViewModel = null;
     NewTabCommand             = new Command(NewTab);
     CloseTabCommand           = new Command(param => CloseTab(param as TabViewModel));
     CloseCurrentTabCommand    = new Command(CloseCurrentTab);
     ExportCommand             = new Command(Export);
     DownloadManagerCommand    = new Command(ShowDownloadManager);
     ImportCommand             = new Command(Import);
     SynchronizeCommand        = new Command(Synchronize);
     SettingsCommand           = new Command(SettingsMenuItemClick);
     WindowClosedCommand       = new Command(WindowClosed);
     TabViewModels             = new ObservableCollection <TabViewModel>();
     Initialize();
 }