You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2020. It is now read-only.
Mark Smith edited this page Jun 4, 2018
·
4 revisions
IViewModelNavigationInit
The IViewModelNavigationInit interface is used to provide an method-based initialization when a view model is about to be used by a Page. This interface should be implemented by the view model and is invoked by the FormsNavigationPageService when the NavigateAsync and PushModalAsync methods are utilized.
Note: The navigation service will call this implementation (if present) on whatever view model is used by the Page. This can be the state parameter passed in (which is assigned as the view model), or it can be a view model created by the Page and associated to the BindingContext in the constructor of the Page.
It has a single method: InitializeAsync which takes the following form:
TaskIntializeAsync(objectstateParameter);
This is called before the Page is navigated to, and after the ViewModel has been assigned as the BindingContext for the Page. It allows for asynchronous initialization and will be awaited prior to performing the navigation.