using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using _280191_TreeViewDataBindingTriStateCheck;

namespace _280191_TreeViewDataBindingTriStateCheck
{

	public class MyTemplateSelector : DataTemplateSelector
	{
		public DataTemplate LeagueTemplate { get; set; }
		public DataTemplate DivisionTemplate { get; set; }
		public DataTemplate TeamTemplate { get; set; }

		public override DataTemplate SelectTemplate(object item, DependencyObject container)
		{

			if (item is League && LeagueTemplate != null)
			{
				return LeagueTemplate;
			}

			if (item is Division && DivisionTemplate != null)
			{
				return DivisionTemplate;
			}
			if (item is Team && TeamTemplate != null)
			{
				return TeamTemplate;
			}

			//Fallback
			return new DataTemplate();
		}

	}
}