Update for Avalonia 12

This commit is contained in:
tyrrrz
2026-05-01 16:30:11 +03:00
parent 07a02773be
commit 5838c0546e
10 changed files with 13 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.VisualTree;
using PowerKit.Extensions;
namespace DiscordChatExporter.Gui.Utils.Extensions;
@@ -15,7 +15,7 @@ internal static class AvaloniaExtensions
public TopLevel? TryGetTopLevel() =>
lifetime.TryGetMainWindow()
?? (lifetime as ISingleViewApplicationLifetime)?.MainView?.GetVisualRoot() as TopLevel;
?? (lifetime as ISingleViewApplicationLifetime)?.MainView?.Pipe(TopLevel.GetTopLevel);
public bool TryShutdown(int exitCode = 0)
{