Rex Hiebert
Rex Hiebert

Reputation: 1

Prism for XF async OnNavigatedTo returning void an not Task?

When overriding the Navigation methods like OnNavigatedTo, I get the warning:

Asynchronous method 'OnNavigatedTo' should not return void

The method is defined as:

public async override void OnNavigatedTo(NavigationParameters parameters){}

Shouldn't this return a Task?

Thanks!

Upvotes: 0

Views: 220

Answers (1)

user5420778
user5420778

Reputation:

No, it does not return a Task. You can see the interface definition here:

https://github.com/PrismLibrary/Prism/blob/master/Source/Xamarin/Prism.Forms/Navigation/INavigatedAware.cs

Also, I'm not sure what you mean by overriding. You do not override this method, you implement it via the INavigationAware or INavigatedAware interfaces.

Upvotes: 1

Related Questions