hi , on my applications last page i have a button , i entered the click event - no errors or warnings - , but whenever i click the button nothing happens. heres the code
Button button = new Button
{
Text = "Log the Click Time",
};
button.Clicked += OnButtonClicked;
this.Padding =
new Thickness(5, Device.OnPlatform(20, 0, 0), 5, 0);
this.Content = new StackLayout
{
Children =
{
button,
new ScrollView
{
VerticalOptions = LayoutOptions.FillAndExpand,
Content = loggerLayout
}
}
};
}
void OnButtonClicked(object sender, EventArgs args)
{
loggerLayout.Children.Add(new Label
{
Text = "Button clicked at " + DateTime.Now.ToString("T")
});
}
}
}
the button is on the last page but it doesnt detect the click event
What I have tried:
to google for a solution- it pointed that the buttons id muight differ , haave xhecked that and retyped the code out . youtube , but doesnt have the results i need . stackoverflow,