Example #1
0
        private void HandleAddRemove(object sender, AddRemoveClickEventArgs e)
        {
            var vm = adapter.GetItem(e.Position);

            if (e.IsAdd)
            {
                cartService.AddProduct(vm.Product, vm.Sale);
            }
            else
            {
                cartService.RemoveProduct(vm.Product);
            }

            vm.Units           = cartService.GetUnits(vm.Product);
            vm.DiscountPercent = cartService.GetDiscountPercent(vm.Product);
            adapter.NotifyItemChanged(e.Position);
            UpdateTotalPrice();
        }
Example #2
0
 private void OnAddRemoveClick(AddRemoveClickEventArgs args) => AddRemoveClick?.Invoke(this, args);