private void OnApplicationUnlocked(ApplicationUnlocked obj) { if (SelectedMenuItem == null) { SelectedItemChangedCommand.Execute(Notebooks.FirstOrDefault()); } }
public void ReadNotebooks() { using (SQLiteConnection conn = new SQLiteConnection(DatabaseHelper.dbFile)) { var notebooks = conn.Table <Notebook>().ToList(); Notebooks.Clear(); foreach (var notebook in notebooks) { Notebooks.Add(notebook); } SelectedNotebook = Notebooks.FirstOrDefault(); } }
public void ReadNotebooks() { using (SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { //TODO: handle this exception (When a table of notebook does not exists) var notebooks = connection.Table <Notebook>().ToList(); Notebooks.Clear(); foreach (Notebook notebook in notebooks) { Notebooks.Add(notebook); } SelectedNotebook = Notebooks.FirstOrDefault(); } }