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(); }
private void OnAddRemoveClick(AddRemoveClickEventArgs args) => AddRemoveClick?.Invoke(this, args);