public void SwitchTheme() { if (Resources?.GetType() == typeof(DarkThemeResources)) { Resources = new LightThemeResources(); return; } Resources = new DarkThemeResources(); }
public void LoadStartPage() { Resources = new DarkThemeResources(); var mainPage = new NavigationService(); mainPage.AddPage <StartPageModel>(AppResources.StartPageText); mainPage.AddPage <PropertyPageModel>(AppResources.PropertyPageText); mainPage.AddPage <LogPageModel>(AppResources.LogPageText); MainPage = mainPage; }
public App() { InitializeComponent(); MainPage = new NavigationPage(new StartUpPage()); if (Application.Current.Properties.ContainsKey("ThemePreference")) { if (Application.Current.Properties["ThemePreference"].Equals("Dark")) { Resources = new DarkThemeResources(); } else { Resources = new LightThemeResources(); } } else { Resources = new DarkThemeResources(); } }