Remove old theme service completely.
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Windows.ApplicationModel.AppService;
|
using Windows.ApplicationModel.AppService;
|
||||||
using Wino.Core.Domain.Interfaces;
|
using Wino.Core.Domain.Interfaces;
|
||||||
using Wino.Core.WinUI.Services;
|
|
||||||
using Wino.Core.ViewModels;
|
using Wino.Core.ViewModels;
|
||||||
|
using Wino.Core.WinUI.Services;
|
||||||
using Wino.Services;
|
using Wino.Services;
|
||||||
|
|
||||||
namespace Wino.Core.WinUI;
|
namespace Wino.Core.WinUI;
|
||||||
@@ -22,7 +22,6 @@ public static class CoreUWPContainerSetup
|
|||||||
services.AddSingleton<INativeAppService, NativeAppService>();
|
services.AddSingleton<INativeAppService, NativeAppService>();
|
||||||
services.AddSingleton<IStoreManagementService, StoreManagementService>();
|
services.AddSingleton<IStoreManagementService, StoreManagementService>();
|
||||||
services.AddSingleton<IPreferencesService, PreferencesService>();
|
services.AddSingleton<IPreferencesService, PreferencesService>();
|
||||||
services.AddSingleton<IThemeService, ThemeService>();
|
|
||||||
services.AddSingleton<INewThemeService, NewThemeService>();
|
services.AddSingleton<INewThemeService, NewThemeService>();
|
||||||
services.AddSingleton<IStatePersistanceService, StatePersistenceService>();
|
services.AddSingleton<IStatePersistanceService, StatePersistenceService>();
|
||||||
services.AddSingleton<IThumbnailService, ThumbnailService>();
|
services.AddSingleton<IThumbnailService, ThumbnailService>();
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ public sealed partial class CustomThemeBuilderDialog : ContentDialog
|
|||||||
public byte[] WallpaperData { get; private set; }
|
public byte[] WallpaperData { get; private set; }
|
||||||
public string AccentColor { get; private set; }
|
public string AccentColor { get; private set; }
|
||||||
|
|
||||||
private IThemeService _themeService;
|
private INewThemeService _themeService;
|
||||||
|
|
||||||
public CustomThemeBuilderDialog()
|
public CustomThemeBuilderDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_themeService = WinoApplication.Current.Services.GetService<IThemeService>();
|
_themeService = WinoApplication.Current.Services.GetService<INewThemeService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ApplyClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
private async void ApplyClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Windows.System;
|
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Windows.System;
|
||||||
using Wino.Core.Domain.Enums;
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Core.Domain.Interfaces;
|
using Wino.Core.Domain.Interfaces;
|
||||||
using Wino.Core.Domain.Models.Accounts;
|
using Wino.Core.Domain.Models.Accounts;
|
||||||
@@ -67,7 +67,7 @@ public sealed partial class NewAccountDialog : ContentDialog
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
var themeService = WinoApplication.Current.ThemeService.GetAvailableAccountColors();
|
var themeService = WinoApplication.Current.NewThemeService.GetAvailableAccountColors();
|
||||||
AvailableColors = themeService.Select(a => new AppColorViewModel(a)).ToList();
|
AvailableColors = themeService.Select(a => new AppColorViewModel(a)).ToList();
|
||||||
|
|
||||||
UpdateSelectedColor();
|
UpdateSelectedColor();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class CustomAppTheme : AppThemeBase
|
|||||||
public override AppThemeType AppThemeType => AppThemeType.Custom;
|
public override AppThemeType AppThemeType => AppThemeType.Custom;
|
||||||
|
|
||||||
public override string GetBackgroundPreviewImagePath()
|
public override string GetBackgroundPreviewImagePath()
|
||||||
=> $"ms-appdata:///local/{ThemeService.CustomThemeFolderName}/{Id}_preview.jpg";
|
=> $"ms-appdata:///local/{NewThemeService.CustomThemeFolderName}/{Id}_preview.jpg";
|
||||||
|
|
||||||
public override async Task<string> GetThemeResourceDictionaryContentAsync()
|
public override async Task<string> GetThemeResourceDictionaryContentAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ using System.Collections.Generic;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Windows.Storage.AccessCache;
|
using Windows.Storage.AccessCache;
|
||||||
using Windows.Storage.Pickers;
|
using Windows.Storage.Pickers;
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Wino.Core.Domain;
|
using Wino.Core.Domain;
|
||||||
using Wino.Core.Domain.Enums;
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Core.Domain.Interfaces;
|
using Wino.Core.Domain.Interfaces;
|
||||||
@@ -25,12 +25,12 @@ public class DialogServiceBase : IDialogServiceBase
|
|||||||
{
|
{
|
||||||
private SemaphoreSlim _presentationSemaphore = new SemaphoreSlim(1);
|
private SemaphoreSlim _presentationSemaphore = new SemaphoreSlim(1);
|
||||||
|
|
||||||
protected IThemeService ThemeService { get; }
|
protected INewThemeService ThemeService { get; }
|
||||||
protected IConfigurationService ConfigurationService { get; }
|
protected IConfigurationService ConfigurationService { get; }
|
||||||
|
|
||||||
protected IApplicationResourceManager<ResourceDictionary> ApplicationResourceManager { get; }
|
protected IApplicationResourceManager<ResourceDictionary> ApplicationResourceManager { get; }
|
||||||
|
|
||||||
public DialogServiceBase(IThemeService themeService, IConfigurationService configurationService, IApplicationResourceManager<ResourceDictionary> applicationResourceManager)
|
public DialogServiceBase(INewThemeService themeService, IConfigurationService configurationService, IApplicationResourceManager<ResourceDictionary> applicationResourceManager)
|
||||||
{
|
{
|
||||||
ThemeService = themeService;
|
ThemeService = themeService;
|
||||||
ConfigurationService = configurationService;
|
ConfigurationService = configurationService;
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public abstract class WinoApplication : Application, IRecipient<LanguageChanged>
|
|||||||
protected IWinoLogger LogInitializer { get; }
|
protected IWinoLogger LogInitializer { get; }
|
||||||
protected IApplicationConfiguration AppConfiguration { get; }
|
protected IApplicationConfiguration AppConfiguration { get; }
|
||||||
protected IWinoServerConnectionManager<AppServiceConnection> AppServiceConnectionManager { get; }
|
protected IWinoServerConnectionManager<AppServiceConnection> AppServiceConnectionManager { get; }
|
||||||
public IThemeService ThemeService { get; }
|
|
||||||
public INewThemeService NewThemeService { get; }
|
public INewThemeService NewThemeService { get; }
|
||||||
public IUnderlyingThemeService UnderlyingThemeService { get; }
|
public IUnderlyingThemeService UnderlyingThemeService { get; }
|
||||||
public IThumbnailService ThumbnailService { get; }
|
public IThumbnailService ThumbnailService { get; }
|
||||||
@@ -56,7 +55,6 @@ public abstract class WinoApplication : Application, IRecipient<LanguageChanged>
|
|||||||
AppConfiguration = Services.GetService<IApplicationConfiguration>();
|
AppConfiguration = Services.GetService<IApplicationConfiguration>();
|
||||||
|
|
||||||
AppServiceConnectionManager = Services.GetService<IWinoServerConnectionManager<AppServiceConnection>>();
|
AppServiceConnectionManager = Services.GetService<IWinoServerConnectionManager<AppServiceConnection>>();
|
||||||
ThemeService = Services.GetService<IThemeService>();
|
|
||||||
NewThemeService = Services.GetService<INewThemeService>();
|
NewThemeService = Services.GetService<INewThemeService>();
|
||||||
DatabaseService = Services.GetService<IDatabaseService>();
|
DatabaseService = Services.GetService<IDatabaseService>();
|
||||||
TranslationService = Services.GetService<ITranslationService>();
|
TranslationService = Services.GetService<ITranslationService>();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Wino.Mail.ViewModels;
|
|||||||
public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
|
public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
|
||||||
{
|
{
|
||||||
private readonly IAccountService _accountService;
|
private readonly IAccountService _accountService;
|
||||||
private readonly IThemeService _themeService;
|
private readonly INewThemeService _themeService;
|
||||||
private readonly IImapTestService _imapTestService;
|
private readonly IImapTestService _imapTestService;
|
||||||
private readonly IMailDialogService _mailDialogService;
|
private readonly IMailDialogService _mailDialogService;
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public partial class EditAccountDetailsPageViewModel : MailBaseViewModel
|
|||||||
public bool IsImapServer => ServerInformation != null;
|
public bool IsImapServer => ServerInformation != null;
|
||||||
|
|
||||||
public EditAccountDetailsPageViewModel(IAccountService accountService,
|
public EditAccountDetailsPageViewModel(IAccountService accountService,
|
||||||
IThemeService themeService,
|
INewThemeService themeService,
|
||||||
IImapTestService imapTestService,
|
IImapTestService imapTestService,
|
||||||
IMailDialogService mailDialogService)
|
IMailDialogService mailDialogService)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public partial class MailListPageViewModel : MailBaseViewModel,
|
|||||||
public INavigationService NavigationService { get; }
|
public INavigationService NavigationService { get; }
|
||||||
public IStatePersistanceService StatePersistenceService { get; }
|
public IStatePersistanceService StatePersistenceService { get; }
|
||||||
public IPreferencesService PreferencesService { get; }
|
public IPreferencesService PreferencesService { get; }
|
||||||
public IThemeService ThemeService { get; }
|
public INewThemeService ThemeService { get; }
|
||||||
|
|
||||||
private readonly IAccountService _accountService;
|
private readonly IAccountService _accountService;
|
||||||
private readonly IMailDialogService _mailDialogService;
|
private readonly IMailDialogService _mailDialogService;
|
||||||
@@ -160,7 +160,7 @@ public partial class MailListPageViewModel : MailBaseViewModel,
|
|||||||
IWinoRequestDelegator winoRequestDelegator,
|
IWinoRequestDelegator winoRequestDelegator,
|
||||||
IKeyPressService keyPressService,
|
IKeyPressService keyPressService,
|
||||||
IPreferencesService preferencesService,
|
IPreferencesService preferencesService,
|
||||||
IThemeService themeService,
|
INewThemeService themeService,
|
||||||
IWinoLogger winoLogger,
|
IWinoLogger winoLogger,
|
||||||
IWinoServerConnectionManager winoServerConnectionManager)
|
IWinoServerConnectionManager winoServerConnectionManager)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Wino.Services;
|
|||||||
|
|
||||||
public class DialogService : DialogServiceBase, IMailDialogService
|
public class DialogService : DialogServiceBase, IMailDialogService
|
||||||
{
|
{
|
||||||
public DialogService(IThemeService themeService,
|
public DialogService(INewThemeService themeService,
|
||||||
IConfigurationService configurationService,
|
IConfigurationService configurationService,
|
||||||
IApplicationResourceManager<ResourceDictionary> applicationResourceManager) : base(themeService, configurationService, applicationResourceManager)
|
IApplicationResourceManager<ResourceDictionary> applicationResourceManager) : base(themeService, configurationService, applicationResourceManager)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user