Fixed EditableListBoxControl mouse wheel scrolling

This commit is contained in:
Ben Wallis
2018-12-03 17:41:44 +00:00
parent a13dc44a7d
commit 6fb0ec8084
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System.Windows;
using System.Windows.Media;
namespace Filtration.Utility
{
public class VisualTreeUtility
{
public static T FindParent<T>(DependencyObject child)
where T : DependencyObject
{
//get parent item
var parentObject = VisualTreeHelper.GetParent(child);
//we've reached the end of the tree
if (parentObject == null) return null;
//check if the parent matches the type we're looking for
if (parentObject is T parent)
{
return parent;
}
return FindParent<T>(parentObject);
}
}
}