Fixed combobox scrolling in ItemFilterBlockView

This commit is contained in:
Ben Wallis 2018-12-05 20:09:30 +00:00
parent 557767f4dc
commit 7c0da57570
1 changed files with 9 additions and 2 deletions

View File

@ -44,8 +44,9 @@ namespace Filtration.Views
if (sender is ScrollViewer viewer && !e.Handled) if (sender is ScrollViewer viewer && !e.Handled)
{ {
// Don't handle events if they originated from a control within an EditableListBoxControl // 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 // or a ComboBox since we still want to allow scrolling within those with the mouse wheel
if (e.OriginalSource is DependencyObject dependencyObject && VisualTreeUtility.FindParent<EditableListBoxControl>(dependencyObject) != null) if (e.OriginalSource is DependencyObject dependencyObject && (VisualTreeUtility.FindParent<EditableListBoxControl>(dependencyObject) != null ||
IsDropDownScrollViewer(dependencyObject)))
{ {
e.Handled = false; e.Handled = false;
return; return;
@ -60,5 +61,11 @@ namespace Filtration.Views
} }
} }
} }
private bool IsDropDownScrollViewer(DependencyObject dependencyObject)
{
var parent = VisualTreeUtility.FindParent<ScrollViewer>(dependencyObject);
return parent != null && parent.Name == "DropDownScrollViewer";
}
} }
} }