From 7c0da575708ebcb36a8c5d7a5595334aa6f434e6 Mon Sep 17 00:00:00 2001 From: Ben Wallis Date: Wed, 5 Dec 2018 20:09:30 +0000 Subject: [PATCH] Fixed combobox scrolling in ItemFilterBlockView --- Filtration/Views/ItemFilterBlockView.xaml.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Filtration/Views/ItemFilterBlockView.xaml.cs b/Filtration/Views/ItemFilterBlockView.xaml.cs index b7f7c6b..f5a915e 100644 --- a/Filtration/Views/ItemFilterBlockView.xaml.cs +++ b/Filtration/Views/ItemFilterBlockView.xaml.cs @@ -44,8 +44,9 @@ namespace Filtration.Views if (sender is ScrollViewer viewer && !e.Handled) { // Don't handle events if they originated from a control within an EditableListBoxControl - // since we still want to allow scrolling within those with the mouse wheel - if (e.OriginalSource is DependencyObject dependencyObject && VisualTreeUtility.FindParent(dependencyObject) != null) + // or a ComboBox since we still want to allow scrolling within those with the mouse wheel + if (e.OriginalSource is DependencyObject dependencyObject && (VisualTreeUtility.FindParent(dependencyObject) != null || + IsDropDownScrollViewer(dependencyObject))) { e.Handled = false; return; @@ -60,5 +61,11 @@ namespace Filtration.Views } } } + + private bool IsDropDownScrollViewer(DependencyObject dependencyObject) + { + var parent = VisualTreeUtility.FindParent(dependencyObject); + return parent != null && parent.Name == "DropDownScrollViewer"; + } } }