I was trying to make a button that passed the information of an entry and a StackLayout and this error appears to me:
public MainPage()
{
InitializeComponent();
Entry entry = new Entry() { Keyboard = Keyboard.Numeric };
Button button = new Button();
StackLayout stack = new StackLayout()
{
Children =
{
button,
entry
}
};
button.Clicked += Button_Clicked(stack, entry); //O erro aparece nessa linha
}
private async void Button_Clicked(StackLayout stack, Entry entry)
{
int qtd_in = Int16.Parse(entry.Text);
for (int i = 0; i < qtd_in; i++)
{
Entry entradas = new Entry();
stack.Children.Add(entradas);
}//O código deveria criar novas entradas de acordo com a primeira entry
}