TopShelfCustomer/TopShelfCustomer/ViewModels/ShopViewModel.cs
/// <summary>
/// Checkout:
///
/// Handles all logic to be executed when the "Checkout" button is clicked
/// </summary>


Handles all logic to be executed when the "Checkout" button is clicked
Handles all logic to be executed when the " Checkout " button is clicked
private void Checkout () {
                UserContainer.UserCart.Items.Clear();
                UserContainer.UserCart.Price = 0.0f;
                foreach ( ShopItem shopItem in ShopInventory ) {
                    if ( shopItem.Quantity > 0 ) {
                        shopItem.Price *= shopItem.Quantity;
                        UserContainer.UserCart.Price += shopItem.Price;
                        UserContainer.UserCart.Items.Add( shopItem );
                    }
                }
                App.SetNewPage<CheckoutView>();
            }
private void Checkout ( ) { UserContainer . UserCart . Items . Clear ( ) ; UserContainer . UserCart . Price = 0.0f ; foreach ( ShopItem shopItem in ShopInventory ) { if ( shopItem . Quantity > 0 ) { shopItem . Price *= shopItem . Quantity ; UserContainer . UserCart . Price += shopItem . Price ; UserContainer . UserCart . Items . Add ( shopItem ) ; } } App . SetNewPage < CheckoutView > ( ) ; }
Checkout:
Checkout :
/* Set the current page to the new View */