コード例 #1
0
        public ReferringSitesViewModel(IMainThread mainThread,
                                       ReviewService reviewService,
                                       FavIconService favIconService,
                                       IVersionTracking versionTracking,
                                       IAnalyticsService analyticsService,
                                       GitHubUserService gitHubUserService,
                                       GitHubApiV3Service gitHubApiV3Service,
                                       DeepLinkingService deepLinkingService,
                                       ReferringSitesDatabase referringSitesDatabase,
                                       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;
            _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();
        }
コード例 #2
0
                    static async Task <MobileReferringSiteModel> setFavIcon(ReferringSiteModel referringSiteModel)
                    {
                        if (referringSiteModel.ReferrerUri != null)
                        {
                            var favIcon = await FavIconService.GetFavIconImageSource(referringSiteModel.ReferrerUri.ToString()).ConfigureAwait(false);

                            return(new MobileReferringSiteModel(referringSiteModel, favIcon));
                        }

                        return(new MobileReferringSiteModel(referringSiteModel, null));
                    }