コード例 #1
0
ファイル: ViewExtensions.cs プロジェクト: jokm1/uno-2
        /// <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();
            }
        }