public ReferringSitesViewModel(IMainThread mainThread,
                                       ReviewService reviewService,
                                       FavIconService favIconService,
                                       IVersionTracking versionTracking,
                                       IAnalyticsService analyticsService,
                                       GitHubUserService gitHubUserService,
                                       GitHubApiV3Service gitHubApiV3Service,
                                       DeepLinkingService deepLinkingService,
                                       ReferringSitesDatabase referringSitesDatabase,
                                       GitHubApiExceptionService gitHubApiExceptionService,
                                       GitHubAuthenticationService gitHubAuthenticationService) : base(analyticsService, mainThread)
        {
            ReviewService.ReviewRequested += HandleReviewRequested;
            ReviewService.ReviewCompleted += HandleReviewCompleted;

            _reviewService               = reviewService;
            _favIconService              = favIconService;
            _versionTracking             = versionTracking;
            _gitHubUserService           = gitHubUserService;
            _gitHubApiV3Service          = gitHubApiV3Service;
            _deepLinkingService          = deepLinkingService;
            _referringSitesDatabase      = referringSitesDatabase;
            _gitHubApiExceptionService   = gitHubApiExceptionService;
            _gitHubAuthenticationService = gitHubAuthenticationService;

            RefreshState = RefreshState.Uninitialized;

            RefreshCommand   = new AsyncCommand <(string Owner, string Repository, string RepositoryUrl, CancellationToken Token)>(tuple => ExecuteRefreshCommand(tuple.Owner, tuple.Repository, tuple.RepositoryUrl, tuple.Token));
            NoButtonCommand  = new Command(() => HandleReviewRequestButtonTapped(ReviewAction.NoButtonTapped));
            YesButtonCommand = new Command(() => HandleReviewRequestButtonTapped(ReviewAction.YesButtonTapped));

            UpdateStoreRatingRequestView();
        }
Example #2
0
        public RepositoryViewModel(IMainThread mainThread,
                                   ImageCachingService imageService,
                                   IAnalyticsService analyticsService,
                                   GitHubUserService gitHubUserService,
                                   MobileSortingService sortingService,
                                   RepositoryDatabase repositoryDatabase,
                                   GitHubApiV3Service gitHubApiV3Service,
                                   GitHubGraphQLApiService gitHubGraphQLApiService,
                                   GitHubApiExceptionService gitHubApiExceptionService,
                                   GitHubAuthenticationService gitHubAuthenticationService,
                                   GitHubApiRepositoriesService gitHubApiRepositoriesService) : base(analyticsService, mainThread)
        {
            LanguageService.PreferredLanguageChanged += HandlePreferredLanguageChanged;

            SetTitleText();

            _imageService                 = imageService;
            _gitHubUserService            = gitHubUserService;
            _mobileSortingService         = sortingService;
            _repositoryDatabase           = repositoryDatabase;
            _gitHubApiV3Service           = gitHubApiV3Service;
            _gitHubGraphQLApiService      = gitHubGraphQLApiService;
            _gitHubApiExceptionService    = gitHubApiExceptionService;
            _gitHubAuthenticationService  = gitHubAuthenticationService;
            _gitHubApiRepositoriesService = gitHubApiRepositoriesService;

            RefreshState = RefreshState.Uninitialized;

            PullToRefreshCommand      = new AsyncCommand(() => ExecutePullToRefreshCommand(gitHubUserService.Alias));
            FilterRepositoriesCommand = new Command <string>(SetSearchBarText);
            SortRepositoriesCommand   = new Command <SortingOption>(ExecuteSortRepositoriesCommand);

            NotificationService.SortingOptionRequested += HandleSortingOptionRequested;

            GitHubAuthenticationService.DemoUserActivated         += HandleDemoUserActivated;
            GitHubAuthenticationService.LoggedOut                 += HandleGitHubAuthenticationServiceLoggedOut;
            GitHubAuthenticationService.AuthorizeSessionCompleted += HandleAuthorizeSessionCompleted;
        }