summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Renderers/ViewCellExtensions.cs
blob: c7504ab47ec6dffa6cad73008fc2f04fc3e856c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Android.Views;
using AView = Android.Views.View;

namespace Xamarin.Forms.Platform.Android
{
	internal static class ViewCellExtensions
	{
		public static bool IsInViewCell(this VisualElement element)
		{
			var parent = element.Parent;
			while (parent != null)
			{
				if (parent is ViewCell)
				{
					return true;
				}
				parent = parent.Parent;
			}

			return false;
		}
	}
}