一.查找某种类型的子控件,并返回一个List集合 public List<T> GetChildObjects<T>(DependencyObject obj, Type typename) where T : FrameworkElement { DependencyObject child = null; List<T> childList = new List<T>(); ; i <= VisualTreeHelper.GetChildrenCo…
一.查找某种类型的子控件,并返回一个List集合 public List<T> GetChildObjects<T>(DependencyObject obj, Type typename) where T : FrameworkElement { DependencyObject child = null; List<T> childList = new List<T>(); ; i <= VisualTreeHelper.GetChildrenCo…
/// 获得指定元素的父元素 /// </summary> /// <typeparam name="T">指定页面元素</typeparam> /// <param name="obj"></param> /// <returns></returns> public T GetParentObject<T>(DependencyObject obj) where T :…