* Moved VisualTreeHelper and PathOfExileColors to Filtration.Common

* Replaced bindings of PathOfExileColors with x:Static
* Fixed Advanced tab of ColorPicker control in theme editor not being clickable
This commit is contained in:
Ben Wallis
2018-12-05 17:40:59 +00:00
parent 0fe21336e6
commit 9f17d84a7f
16 changed files with 55 additions and 34 deletions

View File

@@ -1,26 +0,0 @@
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);
}
}
}