Files
Common-VS2019/SacsMobileMaui/Maui/Utils/SamElementUtil.cs
T

30 lines
767 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sarand.Net.Mobile.Maui.Utils
{
//=======================================================================
public static class SamElementUtil
{
//-------------------------------------------------------------------
/// <summary>
/// Identify the page fo rthis element.
/// </summary>
public static Page? GetPage(this Element element)
{
while (element != null)
{
if (element is Page) return element as Page;
element = element.Parent;
}
return null;
}
//-------------------------------------------------------------------
}
//=======================================================================
}