Exemple #1
0
        void ChangeQuantity_Clicked(System.Object sender, System.EventArgs e)
        {
            var            ctx  = this.BindingContext as ProductListDTO;
            ProductItemDTO item = ((Button)sender).BindingContext as ProductItemDTO;

            MessagingCenter.Send <ProductListView, int>(this, GlobalEventSender.PAYMENT_EDIT_PRODUCT_QUANTITY, item.Id);
        }
Exemple #2
0
        /// <summary>
        /// borra un elemento de la lista.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Delete_Button_Clicked(System.Object sender, System.EventArgs e)
        {
            var            ctx  = this.BindingContext as ProductListDTO;
            ProductItemDTO item = ((Button)sender).BindingContext as ProductItemDTO;

            MessagingCenter.Send <ProductListView, ProductItemDTO>(this, GlobalEventSender.PAYMENT_DELETE_PRODUCT, item);
        }
Exemple #3
0
        void Increment_Clicked(System.Object sender, System.EventArgs e)
        {
            var            ctx  = this.BindingContext as ProductListDTO;
            ProductItemDTO item = ((Button)sender).BindingContext as ProductItemDTO;

            item.Quantity += item.Quantity == 300 ? 0 : 1;
            item.Render();
            ctx.RenderCost();
        }
 /// <summary>
 /// Eliminar un producto y calcular de nuevo el costo total.
 /// </summary>
 /// <param name="item"></param>
 public void Delete(ProductItemDTO item)
 {
     source.Remove(item);
     RenderCost();
 }