public async Task <int> SaveReferringSite(MobileReferringSiteModel referringSiteModel, string repositoryUrl) { var databaseConnection = await GetDatabaseConnection <MobileReferringSitesDatabaseModel>().ConfigureAwait(false); var referringSitesDatabaseModel = MobileReferringSitesDatabaseModel.ToReferringSitesDatabaseModel(referringSiteModel, repositoryUrl); return(await databaseConnection.InsertOrReplaceAsync(referringSitesDatabaseModel).ConfigureAwait(false)); }
public CardView(MobileReferringSiteModel mobileReferringSite) { RowSpacing = 0; RowDefinitions = Rows.Define( (Row.TopPadding, AbsoluteGridLength(TopPadding)), (Row.Card, StarGridLength(1)), (Row.BottomPadding, AbsoluteGridLength(BottomPadding))); ColumnDefinitions = Columns.Define( (Column.LeftPadding, AbsoluteGridLength(16)), (Column.Card, StarGridLength(1)), (Column.RightPadding, AbsoluteGridLength(16))); Children.Add(new CardViewFrame(mobileReferringSite).Row(Row.Card).Column(Column.Card)); this.DynamicResource(BackgroundColorProperty, nameof(BaseTheme.PageBackgroundColor)); }
public static MobileReferringSitesDatabaseModel ToReferringSitesDatabaseModel(MobileReferringSiteModel referringSiteModel, string repositoryUrl) { return(new MobileReferringSitesDatabaseModel { FavIconImageUrl = referringSiteModel.FavIconImageUrl, DownloadedAt = referringSiteModel.DownloadedAt, RepositoryUrl = repositoryUrl, Referrer = referringSiteModel.Referrer, TotalUniqueCount = referringSiteModel.TotalUniqueCount, IsReferrerUriValid = referringSiteModel.IsReferrerUriValid, ReferrerUri = referringSiteModel.ReferrerUri, TotalCount = referringSiteModel.TotalCount }); }
public ReferringSitesDataTemplate(MobileReferringSiteModel mobileReferringSite) : base(() => new CardView(mobileReferringSite)) { }
public ReferringSitesDataTemplate(MobileReferringSiteModel referringSiteModel) : base(() => CreateReferringSitesDataTemplate(referringSiteModel)) { }