diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs index 2dcb52f..7bc9cfa 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs @@ -8,6 +8,7 @@ using System.Xml.Linq; using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Input.Platform; using Avalonia.Interactivity; using Avalonia.Layout; using Avalonia.Media; @@ -120,7 +121,7 @@ private void SetupEditorContextMenu() { var clipboard = TopLevel.GetTopLevel(this)?.Clipboard; if (clipboard == null) return; - var text = await clipboard.GetTextAsync(); + var text = await clipboard.TryGetTextAsync(); if (string.IsNullOrEmpty(text)) return; QueryEditor.TextArea.PerformTextInput(text); }; diff --git a/src/PlanViewer.App/MainWindow.axaml.cs b/src/PlanViewer.App/MainWindow.axaml.cs index 3304a71..726e80a 100644 --- a/src/PlanViewer.App/MainWindow.axaml.cs +++ b/src/PlanViewer.App/MainWindow.axaml.cs @@ -9,6 +9,7 @@ using System.Xml.Linq; using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Input.Platform; using Avalonia.Interactivity; using Avalonia.Layout; using Avalonia.Media; @@ -370,7 +371,7 @@ private async Task PasteXmlAsync() var clipboard = this.Clipboard; if (clipboard == null) return; - var xml = await clipboard.GetTextAsync(); + var xml = await clipboard.TryGetTextAsync(); if (string.IsNullOrWhiteSpace(xml)) { ShowError("The clipboard does not contain any text.");