Outlook sync improvements.
This commit is contained in:
@@ -15,6 +15,8 @@ namespace Wino.Mail.WinUI;
|
||||
|
||||
public partial class App : WinoApplication, IRecipient<NewMailSynchronizationRequested>
|
||||
{
|
||||
private ISynchronizationManager _synchronizationManager;
|
||||
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -77,7 +79,6 @@ public partial class App : WinoApplication, IRecipient<NewMailSynchronizationReq
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
|
||||
protected override async void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
|
||||
{
|
||||
// TODO: Check app relaunch mutex before loading anything.
|
||||
@@ -87,6 +88,8 @@ public partial class App : WinoApplication, IRecipient<NewMailSynchronizationReq
|
||||
var configService = Services.GetRequiredService<IConfigurationService>();
|
||||
var nativeAppService = Services.GetRequiredService<INativeAppService>();
|
||||
|
||||
_synchronizationManager = Services.GetRequiredService<ISynchronizationManager>();
|
||||
|
||||
// Load saved backdrop type before creating window
|
||||
var savedBackdropType = (WindowBackdropType)configService.Get("WindowBackdropTypeKey", (int)WindowBackdropType.Mica);
|
||||
|
||||
@@ -111,8 +114,8 @@ public partial class App : WinoApplication, IRecipient<NewMailSynchronizationReq
|
||||
MainWindow.Activate();
|
||||
}
|
||||
|
||||
public async void Receive(NewMailSynchronizationRequested message)
|
||||
public void Receive(NewMailSynchronizationRequested message)
|
||||
{
|
||||
// TODO: Trigger new sync.
|
||||
_synchronizationManager.SynchronizeMailAsync(message.Options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
<mp:PhoneIdentity PhoneProductId="3879fcfb-a561-4599-9103-e0c9b35a271f" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Wino Mail (Preview)</DisplayName>
|
||||
<DisplayName>Wino Mail</DisplayName>
|
||||
<PublisherDisplayName>Burak KÖSE</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@@ -53,6 +54,13 @@
|
||||
</uap:VisualElements>
|
||||
|
||||
<Extensions>
|
||||
<uap5:Extension Category="windows.startupTask">
|
||||
<uap5:StartupTask
|
||||
TaskId="WinoStartupId"
|
||||
Enabled="true"
|
||||
DisplayName="Wino Startup Service" />
|
||||
</uap5:Extension>
|
||||
|
||||
<!-- Protocol activation: mailto -->
|
||||
<uap:Extension Category="windows.protocol">
|
||||
<uap:Protocol Name="mailto" />
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DialogService : DialogServiceBase, IMailDialogService
|
||||
Type = MailSynchronizationType.FullFolders,
|
||||
};
|
||||
|
||||
WeakReferenceMessenger.Default.Send(new NewMailSynchronizationRequested(options, SynchronizationSource.Client));
|
||||
WeakReferenceMessenger.Default.Send(new NewMailSynchronizationRequested(options));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -49,19 +49,29 @@ public sealed partial class MailListPage : MailListPageAbstract,
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
// Bindings.Update();
|
||||
Bindings.Update();
|
||||
|
||||
// Delegate to ViewModel.
|
||||
if (e.Parameter is NavigateMailFolderEventArgs folderNavigationArgs)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new ActiveMailFolderChangedEvent(folderNavigationArgs.BaseFolderMenuItem, folderNavigationArgs.FolderInitLoadAwaitTask));
|
||||
}
|
||||
|
||||
WeakReferenceMessenger.Default.Register<ClearMailSelectionsRequested>(this);
|
||||
WeakReferenceMessenger.Default.Register<ActiveMailItemChangedEvent>(this);
|
||||
WeakReferenceMessenger.Default.Register<SelectMailItemContainerEvent>(this);
|
||||
WeakReferenceMessenger.Default.Register<DisposeRenderingFrameRequested>(this);
|
||||
}
|
||||
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
|
||||
WeakReferenceMessenger.Default.Unregister<ClearMailSelectionsRequested>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<ActiveMailItemChangedEvent>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<SelectMailItemContainerEvent>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<DisposeRenderingFrameRequested>(this);
|
||||
|
||||
// Dispose all WinoListView items.
|
||||
|
||||
MailListView.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user