Event details page improvements, calendar item update source.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user