public MainPageViewModel() { DB = new DataBase(); RefreshCollect(); RefreshHistory(); RefreshSaved(); }
private void InitStorage() { if (!StorageFileHelper.FolderExists("saved_pages")) { StorageFileHelper.CreateFolder("saved_pages"); } using (var db = new DataBase()) { if (!db.DatabaseExists()) { try { db.CreateDatabase(); } catch { db.Dispose(); if (StorageFileHelper.FileExists("DB.sdf")) { StorageFileHelper.DeleteFile("DB.sdf"); } } } } }