Folder stores replace attached Outlook data files. Gmail and Microsoft sign-in go through Identity Hub. Per-folder retention, multi-select, and IMAP/OAuth reliability fixes.
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 94ea21e..afbfdf2 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -3,7 +3,7 @@
latest
enable
enable
- 0.3.0
+ 0.3.1
Postclient
Postclient
Maksym Sadovnychyy
diff --git a/src/MaksIT.PostClient.UI/App.axaml.cs b/src/MaksIT.PostClient.UI/App.axaml.cs
index 4059dbf..be4eadc 100644
--- a/src/MaksIT.PostClient.UI/App.axaml.cs
+++ b/src/MaksIT.PostClient.UI/App.axaml.cs
@@ -1,8 +1,7 @@
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Threading;
using Avalonia.Markup.Xaml;
using Avalonia.Controls.ApplicationLifetimes;
using MaksIT.PostClient.Client;
@@ -14,7 +13,7 @@ namespace MaksIT.PostClient.UI;
public partial class App : Application {
- private IHost? _host;
+ private ServiceProvider? _services;
public override void Initialize() =>
AvaloniaXamlLoader.Load(this);
@@ -28,39 +27,30 @@ public partial class App : Application {
}
base.OnFrameworkInitializationCompleted();
- ShowMain();
+ Dispatcher.UIThread.Post(ShowMain, DispatcherPriority.Loaded);
}
private void CompleteStartup() {
AppPaths.EnsureDirectories();
- _host = Host.CreateDefaultBuilder()
- .ConfigureAppConfiguration(builder => {
- builder.SetBasePath(AppContext.BaseDirectory);
- builder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false);
- builder.AddJsonFile(AppPaths.SettingsFile(), optional: true, reloadOnChange: true);
- })
- .ConfigureServices((_, services) => {
- services.AddSingleton(_ => new ConfigurationFileService());
- services.AddPostClient();
- services.AddSingleton();
- services.AddSingleton();
- })
- .Build();
+ var services = new ServiceCollection();
+ services.AddSingleton(_ => new ConfigurationFileService());
+ services.AddPostClient();
+ services.AddSingleton();
+ services.AddSingleton();
+ _services = services.BuildServiceProvider();
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) {
- desktop.ShutdownMode = ShutdownMode.OnExplicitShutdown;
- desktop.MainWindow = _host.Services.GetRequiredService();
- ShowMain();
+ desktop.ShutdownMode = ShutdownMode.OnMainWindowClose;
+ desktop.MainWindow = _services.GetRequiredService();
ApplyTrayCopy();
UiLocale.Changed += ApplyTrayCopy;
desktop.ShutdownRequested += async (_, _) => {
- if (_host is null)
+ if (_services is null)
return;
- await _host.Services.GetRequiredService().DisposeAsync();
- await _host.StopAsync();
- _host.Dispose();
- _host = null;
+ await _services.GetRequiredService().DisposeAsync();
+ await _services.DisposeAsync();
+ _services = null;
};
}
}
diff --git a/src/MaksIT.PostClient.UI/MainWindow.axaml.cs b/src/MaksIT.PostClient.UI/MainWindow.axaml.cs
index 8a33656..fd583fd 100644
--- a/src/MaksIT.PostClient.UI/MainWindow.axaml.cs
+++ b/src/MaksIT.PostClient.UI/MainWindow.axaml.cs
@@ -806,14 +806,6 @@ public partial class MainWindow : Window {
return files.FirstOrDefault()?.TryGetLocalPath();
}
- protected override void OnClosing(WindowClosingEventArgs e) {
- if (e.IsProgrammatic)
- return;
- e.Cancel = true;
- if (IsVisible)
- Hide();
- }
-
private void OnExitClick(object? sender, RoutedEventArgs e) {
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime life)
life.Shutdown();
diff --git a/src/MaksIT.PostClient.UI/MaksIT.PostClient.UI.csproj b/src/MaksIT.PostClient.UI/MaksIT.PostClient.UI.csproj
index fb911f4..838641a 100644
--- a/src/MaksIT.PostClient.UI/MaksIT.PostClient.UI.csproj
+++ b/src/MaksIT.PostClient.UI/MaksIT.PostClient.UI.csproj
@@ -20,9 +20,6 @@
-
-
-