summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/DataTemplateExtensions.cs
blob: 066675573f9ca0b7fb1b87884a402d130fbccbd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.ComponentModel;

namespace Xamarin.Forms.Internals
{
	public static class DataTemplateExtensions
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static object CreateContent(this DataTemplate self, object item, BindableObject container)
		{
			var selector = self as DataTemplateSelector;
			if (selector != null)
			{
				self = selector.SelectTemplate(item, container);
			}
			return self.CreateContent();
		}
	}
}