Esempio n. 1
0
        async Task CompleteItem(AlertItem item)
        {
            //item.Done = true;
            await manager.SaveTaskAsync(item);

            //alertList.ItemsSource = await manager.GetAlertItemsAsync();
        }
Esempio n. 2
0
        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");
                        }
                    }
                }
            }
        }
Esempio n. 3
0
 public async Task SaveTaskAsync(AlertItem item)
 {
     if (item.Id == null)
     {
         await alertTable.InsertAsync(item);
     }
     else
     {
         await alertTable.UpdateAsync(item);
     }
 }
Esempio n. 4
0
 public AlertItemViewModel()
 {
     model = new AlertItem();
 }
Esempio n. 5
0
        // Data methods
        async Task AddItem(AlertItem item)
        {
            await manager.SaveTaskAsync(item);

            //alertList.ItemsSource = await manager.GetAlertItemsAsync();
        }