diff --git a/src/AvaloniaNodeEditor/Views/MainWindow.axaml b/src/AvaloniaNodeEditor/Views/MainWindow.axaml index b14ab11..23d513e 100644 --- a/src/AvaloniaNodeEditor/Views/MainWindow.axaml +++ b/src/AvaloniaNodeEditor/Views/MainWindow.axaml @@ -175,12 +175,12 @@ - + + - + + + + + + + + + + + + @@ -204,6 +221,12 @@ + + + + + @@ -215,17 +238,6 @@ - - - - - - - diff --git a/src/AvaloniaNodeEditor/Views/MainWindow.axaml.cs b/src/AvaloniaNodeEditor/Views/MainWindow.axaml.cs index 1bf4070..06dc297 100644 --- a/src/AvaloniaNodeEditor/Views/MainWindow.axaml.cs +++ b/src/AvaloniaNodeEditor/Views/MainWindow.axaml.cs @@ -237,7 +237,8 @@ private void OnGalleryPointerPressed(object? sender, PointerPressedEventArgs e) _galleryDragStart = e.GetPosition(null); // SelectedItem is already updated because GalleryItem (ListBoxItem) marks // PointerPressed as handled (completing its own selection) before this fires. - if (NodeGallery?.SelectedItem is Control selectedItem) + // Use sender (the gallery that registered the handler) to support multiple galleries. + if (sender is ListBox gallery && gallery.SelectedItem is Control selectedItem) { _galleryDragNodeType = selectedItem.Tag as string; }