public void buttonOnClicky(object sender, EventArgs e) { product.ProductID = Int32.Parse(((Button)sender).Name); //Conseguir id CustomSizeEventArgs args = new CustomSizeEventArgs(product); //se le pasa los argumentos al evento OnButtonSizeClicky(args); }
public event EventHandler <CustomSizeEventArgs> ButtonSizeClicky; //Creacion del evento public virtual void OnButtonSizeClicky(CustomSizeEventArgs e) { ButtonSizeClicky?.Invoke(this, e); //Invocar el evento }