System.Windows.Controls.VisualStates.GetImplementationRoot C# (CSharp) Method

GetImplementationRoot() public static method

Gets the implementation root of the Control.
Implements Silverlight's corresponding internal property on Control.
public static GetImplementationRoot ( DependencyObject dependencyObject ) : FrameworkElement
dependencyObject DependencyObject The DependencyObject.
return FrameworkElement
        public static FrameworkElement GetImplementationRoot(DependencyObject dependencyObject)
        {
            Debug.Assert(dependencyObject != null, "DependencyObject should not be null.");
            return 1 == VisualTreeHelper.GetChildrenCount(dependencyObject) ?
                VisualTreeHelper.GetChild(dependencyObject, 0) as FrameworkElement :
                null;
        }