Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: IPartImportsSatisfiedNotification - INavigationAware

$
0
0

Hi Peter,

Sorry, after further investigation I found that an await expression can only occur in the body of a method or lambda expression that is marked with anasync modifier. Hence, what I said about using an await expression inside a synchronous method is wrong. My sincere apologies.

Regarding the topic about where to run database operations, in my opinion it could be possible to run such operations in theOnNavigatedTo method. The problem is that Prism's navigation as out of the box does not support asynchronous operations in theOnNavigatedTo and OnNavigatedFrom methods. Therefore, if you invoke an asynchronous method in theOnNavigatedTo method, the navigation sequence will continue executing without waiting for it to finish and, while in some scenarios this might not represent an issue, in others it could cause an unexpected behavior.

If you want to be able to perform an asynchronous operation inside the OnNavigatedTo and being able to wait for that operation to complete before continuing with the navigation sequence, I believe you could find the approach proposed by a user of the community in the following thread interesting:

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini


Viewing all articles
Browse latest Browse all 1878

Trending Articles



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