From d3e081c95918b3cf55f500e4471701c55a557454 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Sat, 6 Apr 2024 04:08:23 +0300 Subject: [PATCH] Clean up --- LightBulb/Utils/Extensions/AvaloniaExtensions.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/LightBulb/Utils/Extensions/AvaloniaExtensions.cs b/LightBulb/Utils/Extensions/AvaloniaExtensions.cs index c89de95..268fd32 100644 --- a/LightBulb/Utils/Extensions/AvaloniaExtensions.cs +++ b/LightBulb/Utils/Extensions/AvaloniaExtensions.cs @@ -6,13 +6,10 @@ namespace LightBulb.Utils.Extensions; internal static class AvaloniaExtensions { - public static Window? TryGetMainWindow(this IApplicationLifetime lifetime) - { - if (lifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) - return desktopLifetime.MainWindow; - - return null; - } + public static Window? TryGetMainWindow(this IApplicationLifetime lifetime) => + lifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime + ? desktopLifetime.MainWindow + : null; public static void Shutdown(this IApplicationLifetime lifetime, int exitCode = 0) {