Esempio n. 1
0
 private void SetBookTiles(object obj)
 {
     if (BookTiles == null)
     {
         BookTiles = new BookTiles();
     }
     BookView = BookTiles;
 }
Esempio n. 2
0
        public MainViewModel()
        {
            SourceDirectories = new ObservableCollection<SourceDirectory>();
            StarColor = new SolidColorBrush(Colors.White);
            ScrapedColor = new SolidColorBrush(Colors.White);
            ToggleFavouriteColor = new SolidColorBrush(Colors.Black);

            _bookDomain = new BookDomain();
            BookTiles = new BookTiles();
            BookDetails = new BookDetails();
            PdfViewer = new PdfViewer();
            FilterOnTitle = true;
            //  var savedView = AppConfig.LoadSetting("SavedView");
            //switch (savedView)
            //{
            //    case "Tiles":
            //        BookView = BookTiles;
            //        break;

            //    case "Details":
            //        BookView = BookDetails;
            //        break;

            //    default:
            //        BookView = new BookTiles();
            //        break;
            //}
            BookView = BookTiles;
            ProgressService.RegisterSubscriber(this);

            var sortt = new List<string>
            {
                "Title [A-Z]",
                "Title [Z-A]",
                "Date Published [Newest]",
                "Date Published [Oldest]",
                "Date Added [Newest]",
                "Date Added [Oldest]"
            };

            SortList = new ObservableCollection<string>(sortt);
            RefreshAllBooks();
            RefreshPublishersAndAuthors();
            SelectedSort = "Title [A-Z]";
        }
        public MainViewModel()
        {
            SourceDirectories    = new ObservableCollection <SourceDirectory>();
            StarColor            = new SolidColorBrush(Colors.White);
            ScrapedColor         = new SolidColorBrush(Colors.White);
            ToggleFavouriteColor = new SolidColorBrush(Colors.Black);

            _bookDomain   = new BookDomain();
            BookTiles     = new BookTiles();
            BookDetails   = new BookDetails();
            PdfViewer     = new PdfViewer();
            FilterOnTitle = true;
            //  var savedView = AppConfig.LoadSetting("SavedView");
            //switch (savedView)
            //{
            //    case "Tiles":
            //        BookView = BookTiles;
            //        break;

            //    case "Details":
            //        BookView = BookDetails;
            //        break;

            //    default:
            //        BookView = new BookTiles();
            //        break;
            //}
            BookView = BookTiles;
            ProgressService.RegisterSubscriber(this);

            var sortt = new List <string>
            {
                "Title [A-Z]",
                "Title [Z-A]",
                "Date Published [Newest]",
                "Date Published [Oldest]",
                "Date Added [Newest]",
                "Date Added [Oldest]"
            };

            SortList = new ObservableCollection <string>(sortt);
            RefreshAllBooks();
            RefreshPublishersAndAuthors();
            SelectedSort = "Title [A-Z]";
        }