コード例 #1
0
        public HomePageViewModel(INavigationService navigationService, IBooksDB booksDB)
        {
            _booksDB = booksDB;

            /* withourt IOC INagavigationService has to new up a concrete version of service
             * _navigationService= new SomeService()*/

            _navigationService = navigationService;
            addbookscmd        = new Command(addbooksimplementation);
            viewbookscmd       = new Command(ViewBooksFromDb);
            deletebookscmd     = new Command(DeleteBooksFromDB);
        }
コード例 #2
0
 public ViewBooksViewModel(IBooksDB BooksDB)
 {
     _booksDB = BooksDB;
     BooksList();
 }
コード例 #3
0
 public AddBooksViewModel(IBooksDB bookDB, INavigationService navigationService)
 {
     _navigationService = navigationService;
     AddBookCommand     = new Command(AddBookToDb);
     _bookDB            = bookDB;
 }