Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Show another page image click

$
0
0

Hi all,
I am creating an app which on the first screen has an image. I want to click on the image and load another view. I haven't been able to accomplish that.

        var tapGestureRecognizer = new TapGestureRecognizer();

        tapGestureRecognizer.Tapped += async delegate {
            await this.Navigation.PushAsync(new LoginPage().GetLoginPage());
            Xamarin.Forms.Device.BeginInvokeOnMainThread(null);
        }; 

        var img = new Image() {
            HorizontalOptions = LayoutOptions.Center,
            Source = "image.png",
        };

        img.GestureRecognizers.Add (tapGestureRecognizer); 

Can someone please show me what I could be doing incorrectly? Thanks in advance.


Viewing all articles
Browse latest Browse all 58056

Trending Articles