maui-linux/Xamarin.Forms.Platform.UAP/ViewExtensions.cs

20 строки
411 B
C#

using System.Collections.Generic;
namespace Xamarin.Forms.Platform.UWP
{
internal static class ViewExtensions
{
public static IEnumerable<Page> GetParentPages(this Page target)
{
var result = new List<Page>();
var parent = target.Parent as Page;
while (!Application.IsApplicationOrNull(parent))
{
result.Add(parent);
parent = parent.Parent as Page;
}
return result;
}
}
}