diff --git a/Wino.Core.ViewModels/PersonalizationPageViewModel.cs b/Wino.Core.ViewModels/PersonalizationPageViewModel.cs index 6f8776ff..7e2e805e 100644 --- a/Wino.Core.ViewModels/PersonalizationPageViewModel.cs +++ b/Wino.Core.ViewModels/PersonalizationPageViewModel.cs @@ -46,9 +46,9 @@ public partial class PersonalizationPageViewModel : CoreBaseViewModel public List ElementThemes { get; set; } = [ + new ElementThemeContainer(ApplicationElementTheme.Default, Translator.ElementTheme_Default), new ElementThemeContainer(ApplicationElementTheme.Light, Translator.ElementTheme_Light), new ElementThemeContainer(ApplicationElementTheme.Dark, Translator.ElementTheme_Dark), - new ElementThemeContainer(ApplicationElementTheme.Default, Translator.ElementTheme_Default), ]; public List InformationDisplayModes { get; set; } = @@ -202,7 +202,8 @@ public partial class PersonalizationPageViewModel : CoreBaseViewModel /// private void SetInitialValues() { - SelectedElementTheme = ElementThemes.Find(a => a.NativeTheme == _newThemeService.RootTheme); + SelectedElementTheme = ElementThemes.Find(a => a.NativeTheme == _newThemeService.RootTheme) + ?? ElementThemes.FirstOrDefault(); SelectedInfoDisplayMode = PreferencesService.MailItemDisplayMode; var currentAccentColor = _newThemeService.AccentColor; @@ -219,7 +220,9 @@ public partial class PersonalizationPageViewModel : CoreBaseViewModel // Find selected theme, handling backward compatibility where theme ID might not exist var currentThemeId = _newThemeService.CurrentApplicationThemeId; - SelectedAppTheme = currentThemeId.HasValue ? AppThemes.Find(a => a.Id == currentThemeId.Value) : null; + SelectedAppTheme = currentThemeId.HasValue + ? AppThemes.Find(a => a.Id == currentThemeId.Value) ?? AppThemes.FirstOrDefault() + : AppThemes.FirstOrDefault(); // Set the current backdrop from service - backdrop should be independent of theme selection var currentBackdropType = _newThemeService.CurrentBackdropType; diff --git a/Wino.Core.ViewModels/SettingOptionsPageViewModel.cs b/Wino.Core.ViewModels/SettingOptionsPageViewModel.cs index 087fb08e..10fc1f6d 100644 --- a/Wino.Core.ViewModels/SettingOptionsPageViewModel.cs +++ b/Wino.Core.ViewModels/SettingOptionsPageViewModel.cs @@ -45,9 +45,9 @@ public partial class SettingOptionsPageViewModel : CoreBaseViewModel public List ElementThemes { get; } = [ + new(ApplicationElementTheme.Default, Translator.ElementTheme_Default), new(ApplicationElementTheme.Light, Translator.ElementTheme_Light), new(ApplicationElementTheme.Dark, Translator.ElementTheme_Dark), - new(ApplicationElementTheme.Default, Translator.ElementTheme_Default), ]; public bool HasAccounts => Accounts.Count > 0; @@ -253,7 +253,7 @@ public partial class SettingOptionsPageViewModel : CoreBaseViewModel } SelectedElementTheme = ElementThemes.FirstOrDefault(theme => theme.NativeTheme == _newThemeService.RootTheme) - ?? ElementThemes.LastOrDefault(); + ?? ElementThemes.FirstOrDefault(); if (string.IsNullOrWhiteSpace(currentAccentColor)) { diff --git a/Wino.Core/Services/SynchronizationManager.cs b/Wino.Core/Services/SynchronizationManager.cs index af0c486e..a6bf288d 100644 --- a/Wino.Core/Services/SynchronizationManager.cs +++ b/Wino.Core/Services/SynchronizationManager.cs @@ -207,6 +207,15 @@ public class SynchronizationManager : ISynchronizationManager, IRecipient