From 0d6b3d9156601191c1668ea42d9dd69578756d88 Mon Sep 17 00:00:00 2001 From: Ionite Date: Sat, 9 Sep 2023 15:15:38 -0400 Subject: [PATCH] Add Clipboard to App --- StabilityMatrix.Avalonia/App.axaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/StabilityMatrix.Avalonia/App.axaml.cs b/StabilityMatrix.Avalonia/App.axaml.cs index d9d0a9d4..3ae77863 100644 --- a/StabilityMatrix.Avalonia/App.axaml.cs +++ b/StabilityMatrix.Avalonia/App.axaml.cs @@ -16,6 +16,7 @@ using System.Threading.Tasks; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Input.Platform; using Avalonia.Markup.Xaml; using Avalonia.Platform; using Avalonia.Platform.Storage; @@ -87,6 +88,9 @@ public sealed class App : Application [NotNull] public static IStorageProvider? StorageProvider { get; private set; } + [NotNull] + public static IClipboard? Clipboard { get; private set; } + // ReSharper disable once MemberCanBePrivate.Global [NotNull] public static IConfiguration? Config { get; private set; } @@ -212,6 +216,7 @@ public sealed class App : Application VisualRoot = mainWindow; StorageProvider = mainWindow.StorageProvider; + Clipboard = mainWindow.Clipboard ?? throw new NullReferenceException("Clipboard is null"); DesktopLifetime.MainWindow = mainWindow; DesktopLifetime.Exit += OnExit;