System.Windows.FrameworkElement.ApplyTemplate C# (CSharp) Method

ApplyTemplate() private method

private ApplyTemplate ( ) : bool
return bool
		internal bool ApplyTemplate ()
		{
			return NativeMethods.framework_element_apply_template (native);
		}

Usage Example

Example #1
0
 public static Visual GetDescendantByName(FrameworkElement element, string name)
 {
     if (element == null)
     {
         return null;
     }
     if (element.Name == name)
     {
         return element;
     }
     Visual descendantByName = null;
     if (element != null)
     {
         element.ApplyTemplate();
     }
     for (int i = 0; i < VisualTreeHelper.GetChildrenCount(element); i++)
     {
         Visual child = VisualTreeHelper.GetChild(element, i) as Visual;
         descendantByName = GetDescendantByName((FrameworkElement) child, name);
         if (descendantByName != null)
         {
             return descendantByName;
         }
     }
     return descendantByName;
 }
All Usage Examples Of System.Windows.FrameworkElement::ApplyTemplate