public MainViewModel(IPostAppApiService _api, INavigationService _nav, UserNotificationService _not, IClosingApp _ca) { postApp = _api; navigation = _nav; notification = _not; closeApp = _ca; }
public static void ConfigureNavigation(NavigationPage nav, string homePageKey, bool askToClose = false) { IClosingApp closer = ViewModelLocator.GetService <IClosingApp>(); Action act = async() => { if (askToClose) { if (!await UserDialogs.Instance.ConfirmAsync("Vuoi chiudere l'applicazione?", "Chiudi applicazione")) { return; } } closer.CloseApp(); }; ViewModelLocator.NavigationService.Initialize(nav, homePageKey, act); }