public async Task Initialize( ReadingInfo readingInfo, int chaptersCount, ReadingColor color) { this.BackgroundColor = color.SecondBarColor; this.UpdateText(readingInfo); this.readingInfo = readingInfo; this.chaptersCount = chaptersCount; }
private void UpdateText(ReadingInfo readingInfo) { if (readingInfo.ChapterNumber == 0) { this.Text = "مقدمة"; } else { this.Text = DisplayNameHelper.GetChapterDisplayName( readingInfo.IsNT, readingInfo.BookNumber, readingInfo.ChapterNumber); } }
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); }
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); } }
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(); }
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); }