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

            ToProjectPage = new RelayCommand <TeamProjectReference>(project => _navigationService.ToProjectPage(project));

            ReloadPage = new RelayCommand(() => Projects = new TaskNotifier <List <TeamProjectReference> >(GetProjects()));

            ToProfilePage = new RelayCommand(() => _navigationService.ToProfilePage());
        }
コード例 #2
0
 public static void ToOrganizationListPage(this IStackNavigationService navigationService, bool isStackPop = false)
 {
     if (isStackPop)
     {
         navigationService.NavigateToAndRemoveSelf(nameof(OrganizationListPage));
     }
     else
     {
         navigationService.NavigateTo(nameof(OrganizationListPage));
     }
 }
コード例 #3
0
        public ProjectPageViewModel()
        {
            _navigationService = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _vstsRepository    = SimpleIoc.Default.GetInstance <IVSTSRepository>();

            ToProjectItemDetailsPage = new RelayCommand <RichWorkItem>(workItem => _navigationService.ToProjectItemDetailsPage(workItem));
            ToProfilePage            = new RelayCommand(() => _navigationService.ToProfilePage());

            ReloadPage = new AsyncCommand(async() => await LoadTeamsAndWorkItems());

            CurrentView = "Sprint";
        }
コード例 #4
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()));
        }
コード例 #5
0
        public ProjectPageViewModel()
        {
            _navigationService      = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _vstsRepository         = SimpleIoc.Default.GetInstance <IVSTSRepository>();
            _userPreferencesService = SimpleIoc.Default.GetInstance <IUserPreferencesService>();

            ToProjectItemDetailsPage = new RelayCommand <RichWorkItem>(workItem => _navigationService.ToProjectItemDetailsPage(workItem, CurrentProject));
            ToOrganizationListPage   = new RelayCommand(() => _navigationService.ToOrganizationListPage());

            ReloadPage = new AsyncCommand(async() => await LoadData(CurrentProject));

            CurrentView = "Summary";
        }
コード例 #6
0
        public ProjectItemDetailsPageViewModel()
        {
            _navigationService = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _vstsRepository    = SimpleIoc.Default.GetInstance <IVSTSRepository>();

            AssignToMe                     = new AsyncCommand(async() => await AssignToMeAndRefresh());
            ToProfilePage                  = new RelayCommand(() => _navigationService.ToProfilePage());
            ReloadPage                     = new RelayCommand(() => ReloadPageCommand());
            ToProjectItemDetailsPage       = new RelayCommand <RichWorkItem>(workItem => _navigationService.ToProjectItemDetailsPage(workItem));
            ToParentProjectItemDetailsPage = new RelayCommand(() => OnWorkItemClicked(ParentWorkItem.Result));
            ViewMore          = new AsyncCommand(async() => await LaunchBrowserWithWorkItemUri());
            HideDoubleBackTip = new RelayCommand(async() => await HideDoubleBackTipCommand());
        }
コード例 #7
0
        protected NavigableViewModelBase()
        {
            if (!ServiceLocator.IsLocationProviderSet)
            {
                throw new Exception("Le service locator doit être initialisé");
            }
            BackCommand = new ActionCommand((s) => Back());
            GoToCommand = new ActionCommand <string>(s => NavigateTo(s));

            // permet de s'affranchir du passage du service de navigation dans le constructeur
            _navigationService = ServiceLocator.Current.GetInstance <IStackNavigationService>();
            _dialogService     = ServiceLocator.Current.GetInstance <IDialogService>();
        }
コード例 #8
0
ファイル: LoginPageViewModel.cs プロジェクト: vasu-gupta/uado
        public LoginPageViewModel()
        {
            _navigationService     = SimpleIoc.Default.GetInstance <IStackNavigationService>();
            _authenticationService = SimpleIoc.Default.GetInstance <IAuthenticationService>();

            ReloadPage       = new RelayCommand(() => ReloadPageCommand());
            IsAuthenticating = new TaskNotifier <bool>(Task.FromResult(false));

            var applicationContext = SimpleIoc.Default.GetInstance <IApplicationContext>();

            _azureADLoginUrl =
                $"{ClientConstants.BaseAuthorizationUrl}?client_id={applicationContext.AuthApplicationId}" +
                $"&response_type={ClientConstants.AuthorizationResponseType}&scope={applicationContext.AuthScopes}&redirect_uri={applicationContext.AuthRedirectUrl}";

            SourceUri = new Uri(_azureADLoginUrl);
        }
コード例 #9
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;
        }
コード例 #10
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;
        }
コード例 #11
0
 public static void ToProjectListPage(this IStackNavigationService navigationService, AccountData account) => navigationService.NavigateTo(nameof(ProjectListPage), account);
コード例 #12
0
 public static void ToProjectItemDetailsPage(this IStackNavigationService navigationService, RichWorkItem workItem) => navigationService.NavigateTo(nameof(ProjectItemDetails), workItem);
コード例 #13
0
 public static void ToLoginPage(this IStackNavigationService navigationService) => navigationService.NavigateTo(nameof(LoginPage));
コード例 #14
0
 public static void ToAboutPage(this IStackNavigationService navigationService) => navigationService.NavigateTo(nameof(AboutPage));
コード例 #15
0
 public static void ToProjectPage(this IStackNavigationService navigationService) => navigationService.NavigateTo(nameof(ProjectPage));
コード例 #16
0
 public static void ToProjectPage(this IStackNavigationService navigationService, TeamProjectReference project) => navigationService.NavigateTo(nameof(ProjectPage), project);
コード例 #17
0
 public static void ToProjectItemDetailsPage(this IStackNavigationService navigationService, RichWorkItem workItem, TeamProjectReference project)
 => navigationService.NavigateTo(nameof(ProjectItemDetails), new Tuple <RichWorkItem, TeamProjectReference>(workItem, project));