Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);

			// Assemble the page.
			this.Content = new StackLayout
			{
				Children = 
				{
					button,
					new ScrollView
					{
						VerticalOptions = LayoutOptions.FillAndExpand,
						Content = loggerLayout
					}
				}
				};
		}

		void OnButtonClicked(object sender, EventArgs args)
		{
			// Add Label to scrollable StackLayout.
			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,
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900