Rename OSAppTheme to AppTheme. (#45)
OSAppTheme has been renamed to AppTheme in MAUI Preview 14, this ensures that the app builds.pull/47/head
parent
4381e5ab13
commit
1a9e7160d5
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue