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

PRISM ... calling async method in onNavigatedTo or any of the methods from INavigationAware

$
0
0

I'm needing to call an async method when my pages are navigated to. I know making a void async is a no-no, but I really don't see a way around it.

So here is what I'm going to do and I was wondering if there is an async INavigationAware implementation that I'm missing/not finding.

    public void OnNavigatedTo(NavigationParameters parameters)
    {
        if (parameters.ContainsKey("title"))
            Title = (string)parameters["title"] + " and Prism";
    }

change to

    public async void OnNavigatedTo(NavigationParameters parameters)
    {
        if (parameters.ContainsKey("title"))
            Title = (string)parameters["title"] + " and Prism";

        await _processing.GetMenuOptions();
    }

Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>