コード例 #1
0
        private void ChangeTheme()
        {
            Status = "";

            try
            {
                var settings = new SettingsBLL(resourceContextForCurrentView);
                var theme    = settings.GetTheme();

                if (theme == "Dark")
                {
                    AppShell.Current.RequestedTheme = ElementTheme.Light;
                    settings.SaveTheme("Light");
                }
                else
                {
                    AppShell.Current.RequestedTheme = ElementTheme.Dark;
                    settings.SaveTheme("Dark");
                }
            }
            catch (Exception ex)
            {
                Status = ex.Message;
            }
        }