From 9b372c155feabe9ef8142f1a6d22e2186cefdb3f Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Tue, 17 Mar 2026 17:24:19 +0100 Subject: [PATCH] Improve DragAndDropPage --- samples/ControlCatalog/Pages/DragAndDropPage.xaml | 4 ++-- samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/ControlCatalog/Pages/DragAndDropPage.xaml b/samples/ControlCatalog/Pages/DragAndDropPage.xaml index 7982ddc1d0..9b4290ad04 100644 --- a/samples/ControlCatalog/Pages/DragAndDropPage.xaml +++ b/samples/ControlCatalog/Pages/DragAndDropPage.xaml @@ -43,14 +43,14 @@ MaxWidth="260" Background="{DynamicResource SystemAccentColorDark1}" DragDrop.AllowDrop="True"> - Drop some text or files here (Copy) + Drop some text, files, bitmap or custom format here (Copy) - Drop some text or files here (Move) + Drop some text or custom format here (Move) diff --git a/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs b/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs index fe2b306477..fad63dd512 100644 --- a/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs @@ -124,6 +124,9 @@ namespace ControlCatalog.Pages e.DragEffects = e.DragEffects & (DragDropEffects.Copy); } + if (e.DragEffects == DragDropEffects.None) + return; + if (e.DataTransfer.Contains(DataFormat.Text)) { DropState.Content = e.DataTransfer.TryGetText();