예제 #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);
 }