From 5e0a0456c400f922884515350f2d8b1ea0af4205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Mon, 20 Oct 2025 18:27:09 +0200 Subject: [PATCH] Some dispatcher fixes. --- .../AccountCreationDialogControl.xaml.cs | 5 +- .../Views/ManageAccountsPage.xaml.cs | 9 +- .../Dialogs/NewImapSetupDialog.xaml.cs | 3 +- WinoCalendar.slnx | 86 ------------------- 4 files changed, 9 insertions(+), 94 deletions(-) delete mode 100644 WinoCalendar.slnx diff --git a/Wino.Core.WinUI/Controls/AccountCreationDialogControl.xaml.cs b/Wino.Core.WinUI/Controls/AccountCreationDialogControl.xaml.cs index 6c90c9a9..e9156452 100644 --- a/Wino.Core.WinUI/Controls/AccountCreationDialogControl.xaml.cs +++ b/Wino.Core.WinUI/Controls/AccountCreationDialogControl.xaml.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; +using CommunityToolkit.WinUI; using Microsoft.Extensions.DependencyInjection; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; @@ -46,9 +47,9 @@ public sealed partial class AccountCreationDialogControl : UserControl, IRecipie await Task.Delay(2000); - await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + await DispatcherQueue.EnqueueAsync(async () => { - AuthHelpDialogButton.Visibility = Microsoft.UI.Xaml.Visibility.Visible; + AuthHelpDialogButton.Visibility = Microsoft.UI.Xaml.Visibility.Collapsed; }); } diff --git a/Wino.Core.WinUI/Views/ManageAccountsPage.xaml.cs b/Wino.Core.WinUI/Views/ManageAccountsPage.xaml.cs index 6de98c2b..d277f88b 100644 --- a/Wino.Core.WinUI/Views/ManageAccountsPage.xaml.cs +++ b/Wino.Core.WinUI/Views/ManageAccountsPage.xaml.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.Linq; using CommunityToolkit.Mvvm.Messaging; -using MoreLinq; using Microsoft.UI.Xaml.Media.Animation; using Microsoft.UI.Xaml.Navigation; +using MoreLinq; using Wino.Core.Domain; using Wino.Core.Domain.Enums; using Wino.Core.WinUI.Views.Abstract; @@ -97,13 +96,13 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract, GoBackFrame(); } - public async void Receive(AccountUpdatedMessage message) + public void Receive(AccountUpdatedMessage message) { var activePage = PageHistory.FirstOrDefault(a => a.Request.PageType == WinoPage.AccountDetailsPage); if (activePage == null) return; - await Dispatcher.TryRunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + DispatcherQueue.TryEnqueue(() => { activePage.Title = message.Account.Name; }); diff --git a/Wino.Mail.WinUI/Dialogs/NewImapSetupDialog.xaml.cs b/Wino.Mail.WinUI/Dialogs/NewImapSetupDialog.xaml.cs index e0f8703d..7cd2cde2 100644 --- a/Wino.Mail.WinUI/Dialogs/NewImapSetupDialog.xaml.cs +++ b/Wino.Mail.WinUI/Dialogs/NewImapSetupDialog.xaml.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; +using CommunityToolkit.WinUI; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media.Animation; using Wino.Core.Domain.Entities.Shared; @@ -59,7 +60,7 @@ public sealed partial class NewImapSetupDialog : ContentDialog, if (ImapFrame.CanGoBack) { // Go back using Dispatcher to allow navigations in OnNavigatedTo. - await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + await DispatcherQueue.EnqueueAsync(() => { ImapFrame.GoBack(); }); diff --git a/WinoCalendar.slnx b/WinoCalendar.slnx deleted file mode 100644 index e0c9e851..00000000 --- a/WinoCalendar.slnx +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -