コード例 #1
0
        public OrganizationListPageViewModel()
        {
            _navigationService = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _vstsRepository    = SimpleIoc.Default.GetInstance <IVSTSRepository>();

            ToProjectListPage = new RelayCommand <AccountData>(account => _navigationService.ToProjectListPage(account));

            ToProfilePage = new RelayCommand(() => _navigationService.ToProfilePage());

            ToAboutPage = new RelayCommand(() => _navigationService.ToAboutPage());

            ReloadPage = new RelayCommand(() => Organizations = new TaskNotifier <List <AccountData> >(GetOrganizations()));
        }
コード例 #2
0
        public ProfilePageViewModel()
        {
            _navigationService     = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _authenticationService = SimpleIoc.Default.GetInstance <IAuthenticationService>();
            _vstsRespository       = SimpleIoc.Default.GetInstance <IVSTSRepository>();

            UserProfile = new TaskNotifier <UserProfile>(_vstsRespository.GetUserProfile());
            Logout      = new RelayCommand(() => _authenticationService.Logout());
            ToAboutPage = new RelayCommand(() => _navigationService.ToAboutPage());
            ReloadPage  = new RelayCommand(() => ReloadPageCommand());

            NavigateToSourceCode         = new RelayCommand(async() => await Launcher.LaunchUriAsync(new Uri(ClientConstants.GitHubUadoUrl)));
            NavigateToPrivacyPolicy      = new RelayCommand(async() => await Launcher.LaunchUriAsync(new Uri(ClientConstants.PrivacyPolicyUrl)));
            NavigateToTermsAndConditions = new RelayCommand(async() => await Launcher.LaunchUriAsync(new Uri(ClientConstants.TermsAndConditionsUrl)));

            AppVersion = VersionHelper.GetAppVersionWithBuildNumber;
        }
コード例 #3
0
ファイル: SideMenuViewModel.cs プロジェクト: vasu-gupta/uado
        public SideMenuViewModel()
        {
            _navigationService      = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _userPreferencesService = SimpleIoc.Default.GetInstance <IUserPreferencesService>();
            _vstsRespository        = SimpleIoc.Default.GetInstance <IVSTSRepository>();
            _authenticationService  = SimpleIoc.Default.GetInstance <IAuthenticationService>();

            UserProfile = new TaskNotifier <UserProfile>(_vstsRespository.GetUserProfile());
            Logout      = new AsyncCommand(async() => await LogoutPrompt());
            Account     = _userPreferencesService.GetPreferredAccount();

            ToProfilePage          = new RelayCommand(() => _navigationService.ToProfilePage());
            ToAboutPage            = new RelayCommand(() => _navigationService.ToAboutPage());
            ToOrganizationListPage = new RelayCommand(() => _navigationService.NavigateToAndClearStack(nameof(OrganizationListPage)));
            ToProjectListPage      = new RelayCommand(() => _navigationService.NavigateToAndClearStack(nameof(ProjectListPage), Account));

            AppVersion = VersionHelper.GetAppVersionWithBuildNumber;
        }