How can I add a button inside var content page in code-behind? I'm trying to make a list view of content pages each with its own button.
var content = new ContentPage
{
Title = EntryTitulo.Text,
Content = new Label
{
Text = EntryText.Text,
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
},
//I want to add a button here....
};
A
ContentPage
can only have a single child. If you want to add multiple children, they need to be contained in a Layout container, like aStackLayout
or aGrid