summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/DataTemplateSelector.cs
blob: 6a9acca66880971ce6c50c4b7334178f1426b2e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
´╗┐using System.Windows;
using System.Windows.Controls;

namespace Xamarin.Forms.Platform.WinPhone
{
	public abstract class DataTemplateSelector : ContentControl
	{
		public abstract System.Windows.DataTemplate SelectTemplate(object item, DependencyObject container);

		protected override void OnContentChanged(object oldContent, object newContent)
		{
			base.OnContentChanged(oldContent, newContent);

			ContentTemplate = SelectTemplate(newContent, this);
		}
	}
}