Exemplo n.º 1
0
        /// <summary>
        /// Get all ancestor views of <paramref name="view"/>, in order from its immediate parent to the root of the visual tree.
        /// </summary>
        public static IEnumerable <_View> GetVisualAncestry(this _View view)
        {
            var ancestor = view.GetVisualTreeParent();

            while (ancestor != null)
            {
                yield return(ancestor);

                ancestor = ancestor.GetVisualTreeParent();
            }
        }