internal static IEnumerable <T> GetChildren <T>(this DependencyObject parent) where T : FrameworkElement
 {
     return(parent.GetChildrenRecursive().OfType <T>());
 }
 /// <summary>
 /// Gets all child elements recursively from the visual tree by given type.
 /// </summary>
 public static IEnumerable <T> ChildrenOfType <T>(this DependencyObject element) where T : DependencyObject
 {
     return(element.GetChildrenRecursive().OfType <T>());
 }