示例#1
0
        public async Task Initialize(
            ReadingInfo readingInfo, 
            int chaptersCount,
            ReadingColor color)
        {
            this.BackgroundColor = color.SecondBarColor;

            this.UpdateText(readingInfo);

            this.readingInfo = readingInfo;
            this.chaptersCount = chaptersCount;
        }
示例#2
0
 private void UpdateText(ReadingInfo readingInfo)
 {
     if (readingInfo.ChapterNumber == 0)
     {
         this.Text = "مقدمة";
     }
     else
     {
         this.Text = DisplayNameHelper.GetChapterDisplayName(
             readingInfo.IsNT,
             readingInfo.BookNumber,
             readingInfo.ChapterNumber);
     }
 }
示例#3
0
        public async Task Initialize(
            ReadingInfo readingInfo,
            BookInfo bookInfo,
            Dictionary<int, Grid> verses,
            ReadingColor color)
        {
            this.BackgroundColor = color.SecondBarColor;

            await this.chapterLabel.Initialize(
                readingInfo: readingInfo,
                chaptersCount: bookInfo.ChaptersCount,
                color: color);

            await this.bookLabel.Initialize(
                author: readingInfo.Author,
                isNT: readingInfo.IsNT,
                bookNumber: readingInfo.BookNumber, 
                bookName: bookInfo.Name,
                color: color);

            await this.verseLabel.Initialize(verses, color);

            this.settingsLabel.Initialize(color);
        }
示例#4
0
 private async Task OnChapterChanged(ChaptersGrid sender, ReadingInfo readingInfo)
 {
     if (this.readingInfo.Author != readingInfo.Author ||
         this.readingInfo.IsNT != readingInfo.IsNT ||
         this.readingInfo.BookNumber != readingInfo.BookNumber ||
         this.readingInfo.ChapterNumber != readingInfo.ChapterNumber)
     {
         await this.Initialize(readingInfo);
     }
     else
     {
         // CaptersGrid showed loading, unshowing it here
         this.ToggleLoading(false);
     }
 }
示例#5
0
        public async Task Initialize(
            ReadingInfo readingInfo,
            double x = 0,
            double y = 0,
            bool isFirstTime = false)
        {
            this.readingInfo = readingInfo;
            this.scrollX = x;
            this.scrollY = y;

            // This has internal cache
            List<BookInfo> booksInfo = await BookNameManager.GetBookNames(readingInfo.IsNT);
            BookInfo bookInfo = booksInfo[readingInfo.BookNumber - 1];

            ReadingColor color = SettingsManager.ToColor(SettingsManager.GetBackgroundColor());
            this.BackgroundColor = color.BackgroundColor;

            await this.authorLabel.Initialize(
                ReadingPage.AuthorChangedMessage,
                this.readingInfo.Author,
                this.readingInfo.IsNT,
                this.readingInfo.BookNumber,
                color);

            await this.UpdateContent(isFirstTime, color);

            await this.bookChapterLabel.Initialize(
                readingInfo,
                bookInfo,
                this.verses,
                color);

            this.ToggleLoading(false);

            this.isFullScreen = true;
            this.AdjustFullScreen();
        }
示例#6
0
 public static Task SaveLastPosition(ReadingInfo readingInfo, double x, double y)
 {
     string value = readingInfo.ToPositionString(x, y);
     Application.Current.Properties[Constants.Properties.LastPosition] = value;
     return Task.FromResult(true);
 }