From 149cde1760f49f53bb24c9dc5b593db24f7f09a4 Mon Sep 17 00:00:00 2001 From: Fexty12573 Date: Sat, 21 Feb 2026 12:57:05 +0100 Subject: [PATCH] Implement drag and drop for game files --- Windows/MainWindow.xaml | 4 +++- Windows/MainWindow.xaml.cs | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Windows/MainWindow.xaml b/Windows/MainWindow.xaml index 783af4c7..f0cc4a16 100644 --- a/Windows/MainWindow.xaml +++ b/Windows/MainWindow.xaml @@ -10,7 +10,9 @@ Width="1800" Height="500" DataContext="{x:Reference this}" - WindowStartupLocation="CenterScreen"> + WindowStartupLocation="CenterScreen" + Drop="MainWindow_OnDrop" + AllowDrop="True"> diff --git a/Windows/MainWindow.xaml.cs b/Windows/MainWindow.xaml.cs index 87aafc36..f270c9bf 100644 --- a/Windows/MainWindow.xaml.cs +++ b/Windows/MainWindow.xaml.cs @@ -828,5 +828,14 @@ protected override void OnClosed(EventArgs e) { base.OnClosed(e); } + + private void MainWindow_OnDrop(object sender, DragEventArgs e) { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) { + var files = (string[]) e.Data.GetData(DataFormats.FileDrop); + if (files != null && files.Length > 0) { + Load(files[0]); + } + } + } } } \ No newline at end of file