private void InitializeDatabase() { string[] lines = QuoteAppUtils.ReadLocalFile("QuoteApp.Resources.QuotesDatabaseLite.csv").Skip(1).ToArray(); var csvDataReader = new CsvDataReader(lines); _quotes = csvDataReader.Quotes; _autors = csvDataReader.Autors; _themes = csvDataReader.Themes; _autorQuoteThemes = csvDataReader.AutorQuoteThemes; PopulateDatabase(); PersistentProperties.Instance.DatabaseIsInitialized = true; }
private void SetPageContent() { NavigationPage.SetHasNavigationBar(this, false); SKColor[] themeColors = PersistentProperties.Instance.NightModeActivated ? ThemeNightBackgroundColorItems.Select(x => SKColor.Parse(x.ColorCode)).ToArray() : ThemeDayBackgroundColorItems.Select(x => SKColor.Parse(x.ColorCode)).ToArray(); float[] gradientPositions = PersistentProperties.Instance.NightModeActivated ? ThemeNightBackgroundColorItems.Select(x => x.GradientPosition).ToArray() : ThemeDayBackgroundColorItems.Select(x => x.GradientPosition).ToArray(); var background = QuoteAppUtils.CreateGradientBackground(themeColors, gradientPositions); Content = new AbsoluteLayout { Children = { { background, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All }, { ContentRoot, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All } } }; }