Phillip Carter
Phillip Carter

Reputation: 5005

How to navigate between pages in Xamarin.Forms for F#

I'm building a Xamarin.Forms app in F#. So far it's pretty great, but I can't figure out how to navigate between pages. In C#, I normally do something like this:

var tapRecognizer = new TapGestureRecognizer();
tapRecognizer .Tapped += async (s, e) =>
    await Navigation.PushAsync(new MyNewPage());

Navigation.PushAsync does not seem to be available in F#. Is there an alternative, or is navigation tucked away in a namespace other than Xamarin.Forms?

Upvotes: 4

Views: 292

Answers (1)

Phillip Carter
Phillip Carter

Reputation: 5005

Well, the answer is pretty simple:

this.Navigation.PushAsync(MyNewPage())

I was missing the explicit this call. Sheer brilliance.

Upvotes: 1

Related Questions