示例#1
0
        public Task InitializeAsync()
        {
            _localDataService.Initialize();

            if (Globals.LoggedInUser == null)
            {
                User localUser = _localDataService.GetUser();

                if (localUser != null)
                {
                    Globals.LoggedInUser = localUser;
                    App.Current.MainPage = new MainView();
                    return(NavigateToAsync <DashboardViewModel>());
                }
                else
                {
                    return(NavigateToAsync <LoginViewModel>());
                }
            }
            else
            {
                App.Current.MainPage = new MainView();
                return(NavigateToAsync <DashboardViewModel>());
            }
        }
        public CredentialListPageViewModel(INavigationService navigationService, ICredentialService credentialService, ILocalDataService localDataService)
            : base(navigationService)
        {
            Title = "Saved Credentials";
            this.localDataService  = localDataService ?? throw new ArgumentNullException(nameof(localDataService));
            this.navigationService = navigationService ?? throw new ArgumentNullException(nameof(navigationService));
            this.credentialService = credentialService ?? throw new ArgumentNullException(nameof(credentialService));

            localDataService.Initialize();
        }