private void InitStorage() { if (!StorageFileHelper.FolderExists("books")) { StorageFileHelper.CreateFolder("books"); } using (var db = new DataBase.DataBase()) { if (!db.DatabaseExists()) { try { db.CreateDatabase(); } catch { db.Dispose(); if (StorageFileHelper.FileExists("DB.sdf")) { StorageFileHelper.DeleteFile("DB.sdf"); } } } } }
public BookListViewModel() { DB = new DataBase.DataBase(); var items = from item in DB.Books select item; _booklist = new ObservableCollection<BookInfo>(items); }
public BookListViewModel() { DB = new DataBase.DataBase(); var items = from item in DB.Books select item; _booklist = new ObservableCollection <BookInfo>(items); }