This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Page1 : ContentPage | |
{ | |
Label labelSuggestion; | |
public Page1() | |
{ | |
InitializeComponent(); | |
labelSuggestion = new Label() | |
{ | |
Text = "Please Click US", | |
IsVisible = true, | |
TextColor = Color.Black, | |
VerticalOptions = LayoutOptions.Center, | |
HorizontalOptions = LayoutOptions.Center, | |
BackgroundColor = Color.Green, | |
}; | |
Content = labelSuggestion; | |
this.Content = new StackLayout | |
{ | |
Children = | |
{ | |
labelSuggestion | |
} | |
}; | |
labelSuggestion.GestureRecognizers.Add(new TapGestureRecognizer((view) => OnLabelClicked())); | |
} | |
//private async void TapGestureRecognizer_Tapped(object sender, EventArgs e) | |
// { | |
// await Navigation.PushAsync(new Page2()); | |
// } | |
private async void OnLabelClicked() | |
{ | |
//var url = "https://docs.google.com/forms/d/e/1FAIpQLSdGn31o21N1s8ixMPqfSmtk07SHiL-FJCCm10kK6enrsZwpbw/viewform"; | |
//Device.OpenUri(new Uri(url)); | |
await Navigation.PushAsync(new Page2()); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--<StackLayout HorizontalOptions="Center" VerticalOptions="Center"> | |
<Label Text="This is Label Clicked Event" | |
VerticalOptions="Center" | |
HorizontalOptions="Center"> | |
<Label.GestureRecognizers> | |
<TapGestureRecognizer | |
Tapped="TapGestureRecognizer_Tapped" | |
/> | |
</Label.GestureRecognizers> | |
</Label> | |
</StackLayout>--> |
No comments:
Post a Comment