Rename OSAppTheme to AppTheme. (#45)

OSAppTheme has been renamed to AppTheme in MAUI Preview 14, this ensures that the app builds.
pull/47/head
Parker Bibus 2022-03-22 12:04:04 -05:00 committed by GitHub
parent 4381e5ab13
commit 1a9e7160d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -100,7 +100,7 @@
private async Task UpdateWebThemeAsync()
{
var darkModeIsActive = Settings.Theme == OSAppTheme.Dark;
var darkModeIsActive = Settings.Theme == AppTheme.Dark;
await ThemeInterop.SetTheme(darkModeIsActive ? Theme.Dark : Theme.Light);
}

View File

@ -2,11 +2,11 @@
public static class Settings
{
const OSAppTheme theme = OSAppTheme.Light;
const AppTheme theme = AppTheme.Light;
public static OSAppTheme Theme
public static AppTheme Theme
{
get => Enum.Parse<OSAppTheme>(Preferences.Get(nameof(Theme), Enum.GetName(theme)));
get => Enum.Parse<AppTheme>(Preferences.Get(nameof(Theme), Enum.GetName(theme)));
set => Preferences.Set(nameof(Theme), value.ToString());
}

View File

@ -7,11 +7,11 @@ public static class TheTheme
switch (Settings.Theme)
{
default:
case OSAppTheme.Light:
App.Current.UserAppTheme = OSAppTheme.Light;
case AppTheme.Light:
App.Current.UserAppTheme = AppTheme.Light;
break;
case OSAppTheme.Dark:
App.Current.UserAppTheme = OSAppTheme.Dark;
case AppTheme.Dark:
App.Current.UserAppTheme = AppTheme.Dark;
break;
}

View File

@ -33,15 +33,15 @@ public class SettingsViewModel : BaseViewModel
public SettingsViewModel()
{
isDarkModeEnabled = Settings.Theme == OSAppTheme.Dark;
isDarkModeEnabled = Settings.Theme == AppTheme.Dark;
isWifiOnlyEnabled = Settings.IsWifiOnlyEnabled;
}
private void ChangeUserAppTheme(bool activateDarkMode)
{
Settings.Theme = activateDarkMode
? OSAppTheme.Dark
: OSAppTheme.Light;
? AppTheme.Dark
: AppTheme.Light;
TheTheme.SetTheme();
}