Fixed ScrollViewer event handling special casing
This commit is contained in:
parent
7c0da57570
commit
4052d6e020
|
@ -45,8 +45,8 @@ namespace Filtration.Views
|
||||||
{
|
{
|
||||||
// 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
|
||||||
// or a ComboBox 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 && (IsDropDownScrollViewer(dependencyObject) || ParentIsEditableListBoxControl(dependencyObject) ||
|
||||||
IsDropDownScrollViewer(dependencyObject)))
|
ParentIsDropDownScrollViewer(dependencyObject)))
|
||||||
{
|
{
|
||||||
e.Handled = false;
|
e.Handled = false;
|
||||||
return;
|
return;
|
||||||
|
@ -62,10 +62,19 @@ namespace Filtration.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsDropDownScrollViewer(DependencyObject dependencyObject)
|
private static bool ParentIsEditableListBoxControl(DependencyObject dependencyObject)
|
||||||
|
{
|
||||||
|
return VisualTreeUtility.FindParent<EditableListBoxControl>(dependencyObject) != null;
|
||||||
|
}
|
||||||
|
private static bool ParentIsDropDownScrollViewer(DependencyObject dependencyObject)
|
||||||
{
|
{
|
||||||
var parent = VisualTreeUtility.FindParent<ScrollViewer>(dependencyObject);
|
var parent = VisualTreeUtility.FindParent<ScrollViewer>(dependencyObject);
|
||||||
return parent != null && parent.Name == "DropDownScrollViewer";
|
return parent != null && parent.Name == "DropDownScrollViewer";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsDropDownScrollViewer(DependencyObject dependencyObject)
|
||||||
|
{
|
||||||
|
return dependencyObject is ScrollViewer scrollViewer && scrollViewer.Name == "DropDownScrollViewer";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue