async Task CompleteItem(AlertItem item) { //item.Done = true; await manager.SaveTaskAsync(item); //alertList.ItemsSource = await manager.GetAlertItemsAsync(); }
private async Task RefreshItem(bool showActivityIndicator) { //using (var scope = new ActivityIndicatorScope(syncIndicator, showActivityIndicator)) { count++; AlertItem item = await manager.GetLatestAlertItemAsync(); if (item != null) { vm.AlertValue = "#" + count + " " + DateTime.Now.ToLocalTime() + " : " + item.AlertValue; decimal av; if (decimal.TryParse(item.AlertValue, out av)) { if (av < 0) { babyImage.Source = ImageSource.FromFile("babydown.jpg"); } else { babyImage.Source = ImageSource.FromFile("babyup.jpg"); } } } } }
public async Task SaveTaskAsync(AlertItem item) { if (item.Id == null) { await alertTable.InsertAsync(item); } else { await alertTable.UpdateAsync(item); } }
public AlertItemViewModel() { model = new AlertItem(); }
// Data methods async Task AddItem(AlertItem item) { await manager.SaveTaskAsync(item); //alertList.ItemsSource = await manager.GetAlertItemsAsync(); }