Initial commit

This commit is contained in:
2014-04-30 17:33:21 -04:00
commit f965f46fb3
33 changed files with 2949 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System.Windows;
using System.Windows.Media;
namespace Common.Wpf.Extensions
{
public static class DependencyObjectExtensions
{
public static T GetAncestor<T>(this DependencyObject referenceObject) where T : class
{
DependencyObject parent = VisualTreeHelper.GetParent(referenceObject);
while (parent != null && !parent.GetType().Equals(typeof(T)))
{
parent = VisualTreeHelper.GetParent(parent);
}
return parent as T;
}
}
}