コード例 #1
0
        private async void SaveCancelClicked(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            switch (btn.Text.Trim(' '))
            {
            case "Done":
                double amount = Double.Parse(amountLabel.Text.Substring(1));
                string reason = reasonLabel.Text;

                Withdrawl withdrawl = new Withdrawl
                {
                    DatePerformed = DateTime.Now,
                    Amount        = amount,
                    Reason        = reason
                };
                DB.conn.Insert(withdrawl);
                await Navigation.PopModalAsync();

                player.Play();
                break;

            case "Cancel":
                await Navigation.PopModalAsync();

                break;
            }
        }
コード例 #2
0
        async void MoreInfoTap(Withdrawl withdrawl)
        {
            bool answer = await DisplayAlert(withdrawl.DatePerformed.ToShortDateString() + " - $" + withdrawl.Amount.ToString(), "Reason: " + withdrawl.Reason, "Delete", "Cancel");

            if (answer)
            {
                bool areYouSure = await DisplayAlert("Are you sure?", "", "Delete", "Cancel");

                if (areYouSure)
                {
                    DB.conn.Delete(withdrawl);
                    ResetListViewSources();
                }
            }
        }
コード例 #3
0
        void withdrawlList_ItemTapped(System.Object sender, Xamarin.Forms.ItemTappedEventArgs e)
        {
            Withdrawl withdrawlTapped = (Withdrawl)((ListView)sender).SelectedItem;

            MoreInfoTap(withdrawlTapped);
        }