Event details page improvements, calendar item update source.

This commit is contained in:
Burak Kaan Köse
2026-02-12 18:04:29 +01:00
parent 96dcdc8e03
commit b01fa4e4ba
26 changed files with 471 additions and 102 deletions
@@ -51,8 +51,13 @@ public sealed partial class AccountDetailsPage : AccountDetailsPageAbstract
if (e.NavigationMode == NavigationMode.New)
{
// Set initial tab to Mail (index 1)
TabSelector.SelectedItem = TabSelector.Items[1];
var targetTabIndex = ViewModel.SelectedTabIndex;
if (targetTabIndex < 0 || targetTabIndex >= TabSelector.Items.Count)
{
targetTabIndex = 1;
}
TabSelector.SelectedItem = TabSelector.Items[targetTabIndex];
}
}
}
@@ -2,6 +2,7 @@ using System;
using System.Text.Json;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.Messaging;
using CommunityToolkit.WinUI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
@@ -77,6 +78,12 @@ public sealed partial class EventDetailsPage : EventDetailsPageAbstract,
private async Task RenderDescriptionAsync()
{
if (DispatcherQueue != null && !DispatcherQueue.HasThreadAccess)
{
await DispatcherQueue.EnqueueAsync(RenderDescriptionAsync);
return;
}
if (ViewModel?.CurrentEvent?.CalendarItem == null)
return;
@@ -141,6 +148,12 @@ public sealed partial class EventDetailsPage : EventDetailsPageAbstract,
private async Task UpdateEditorThemeAsync()
{
if (DispatcherQueue != null && !DispatcherQueue.HasThreadAccess)
{
await DispatcherQueue.EnqueueAsync(UpdateEditorThemeAsync);
return;
}
await DOMLoadedTask.Task;
if (ViewModel.IsDarkWebviewRenderer)
@@ -171,9 +184,9 @@ public sealed partial class EventDetailsPage : EventDetailsPageAbstract,
_ = UpdateEditorThemeAsync();
}
async void IRecipient<CalendarDescriptionRenderingRequested>.Receive(CalendarDescriptionRenderingRequested message)
void IRecipient<CalendarDescriptionRenderingRequested>.Receive(CalendarDescriptionRenderingRequested message)
{
await RenderDescriptionAsync();
_ = RenderDescriptionAsync();
}
protected override void RegisterRecipients()