Example #1
0
        private async void Proceed_Click(object sender, EventArgs e)
        {
            ShowOrdering();
            var Errors = await api.AddNewOrder(Customer.Id, BillingAddress.Id, ShippingAddress.Id, ShippingMethodPicker.ToString(), PaymentPicker.SelectedItem.ToString(), Convert.ToBoolean(GiftWrapCheck.IsChecked));

            HideLoading();
            if (Errors.Length == 0)
            {
                CustomMessageBox SuccessMessage = new CustomMessageBox()
                {
                    Title              = "Order Successful",
                    Message            = "Your order was successful",
                    LeftButtonContent  = "Review Order",
                    RightButtonContent = "Go to Store"
                };
                SuccessMessage.Show();
                SuccessMessage.Dismissed += (s1, e1) =>
                {
                    if (e1.Result.Equals(CustomMessageBoxResult.RightButton))
                    {
                        UserSettings.Remove("refresh_cart");
                        UserSettings.Add("refresh_cart", true);
                        NavigationService.GoBack();
                    }
                    else if (e1.Result.Equals(CustomMessageBoxResult.LeftButton))
                    {
                        Finished = true;
                        ApplicationBar.Buttons.RemoveAt(0);
                        ApplicationBarIconButton b = new ApplicationBarIconButton();
                        b.Text    = "To Store";
                        b.IconUri = new Uri("/Images/arrowLeft.png", UriKind.Relative);
                        b.Click  += (e2, s2) => {
                            UserSettings.Remove("refresh_cart");
                            UserSettings.Add("refresh_cart", true);
                            NavigationService.GoBack();
                        };
                        ApplicationBar.Buttons.Add(b);

                        CheckoutPivot.IsLocked = true;
                        CheckoutProgress.Value = 100;
                    }
                };
            }
        }