Exemple #1
0
        private async void CancelAddItemClicked(object sender, EventArgs e)
        {
            //await TasksGrid.TranslateTo(-LocalWidth, 0, duration, Easing.SinInOut);
            await AddGrid.TranslateTo(0, LocalHeight, duration, Easing.SinOut);

            CurrentViewModel.ShowAdd = false;
        }
Exemple #2
0
        private async void ConfirmAddItemOkClicked(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(CurrentViewModel.Data.ProductPrice) ||
                    string.IsNullOrEmpty(CurrentViewModel.Data.ProductName))
                {
                    await DisplayAlert("Missing information",
                                       "Please make sure you have filled out the product information to save", "OK");


                    return;
                }
                CurrentViewModel.SpendData.Add(CurrentViewModel.Data);
                CurrentViewModel.Data = new SpendObject();
                await AddGrid.TranslateTo(0, LocalHeight, duration, Easing.SinOut);

                CurrentViewModel.ShowAdd = false;
                CalculateTotals();

                var dt    = CurrentViewModel.SerializeDataBase(CurrentViewModel.SpendData);
                var saved = await CurrentViewModel.SaveAnyString(dt, Constants.CurrentSpendList);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                await DisplayAlert("Failed", "Unable to save your list of items", "OK");
            }
        }
Exemple #3
0
 private async void AddItemClicked(object sender, EventArgs e)
 {
     CurrentViewModel.ShowAdd = true;
     await AddGrid.TranslateTo(0, 0, duration, Easing.SinOut);
 }