public static Visual FindDescendantByType(Visual element, Type type)
 {
     return(VisualTreeHelperEx.FindDescendantByType(element, type, true));
 }
        public static T FindDescendantByType <T>(Visual element) where T : Visual
        {
            Visual temp = VisualTreeHelperEx.FindDescendantByType(element, typeof(T));

            return(( T )temp);
        }