private void button_Click(object sender, RoutedEventArgs e) { var storage = new Services.PersistentStorage(); var focus = new Services.FocusService(storage); focus.EndActivity(CurrentActivity); }
public void LoadData() { var storage = new Services.PersistentStorage(); var historyFromDb = storage.Db.Table <Models.Activity>().ToArray(); ActivityHistory = new ObservableCollection <Models.Activity>(historyFromDb); storage.Initialize(); storage.Dispose(); }
private void button_Click(object sender, RoutedEventArgs e) { var storage = new Services.PersistentStorage(); var act = new Models.Activity() { StartedAt = DateTime.Now, }; // TODO insert via focus ActivityHistory.Add(act); storage.Db.Insert(act); var focus = new Services.FocusService(storage); var activity = focus.RetrieveCurrentActivity(); new FocusBar(activity).Show(); Close(); }