File: NodeExtensions.cs
Web Access
Project: src\src\Controls\src\Xaml\Controls.Xaml.csproj (Microsoft.Maui.Controls.Xaml)
namespace Microsoft.Maui.Controls.Xaml;
 
internal static class NodeExtensions
{
	public static bool TryGetPropertyName(this INode node, INode parentNode, out XmlName name)
	{
		name = default;
 
		if (parentNode is not IElementNode parentElement)
		{
			return false;
		}
 
		foreach (var kvp in parentElement.Properties)
		{
			if (kvp.Value != node)
			{
				continue;
			}
 
			name = kvp.Key;
			return true;
		}
 
		return false;
	}
}