Beispiel #1
0
 public static T ElementsFind <T>(this DependencyObject item) where T : DependencyObject
 {
     return(item.Elements <T>().FirstOrDefault() as T);
 }
Beispiel #2
0
 /// <summary>
 /// Returns a collection of child elements which match the given type.
 /// </summary>
 /// <para>Usage:
 /// this.Elements<XamDataChart>(); // all XamDataChart controls
 /// </para>
 public static IEnumerable <DependencyObject> Elements <T>(this DependencyObject item)
 {
     return(item.Elements().Where(i => i is T));
 }