using System.Windows;
using System.Windows.Controls;

namespace CellTemplateSelector_MultipleColumns
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		public MainWindow()
		{
			InitializeComponent();	
		}		
	}


	public class MyCellTemplateSelector : DataTemplateSelector
	{
		public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
		{
			if (item is Player)
			{
				Player player = item as Player;
				if (player.Number == 0 )
				{
					return zeroStyle;
				}
				else if (player.Number == 1)
				{
					return oneStyle;
				}
				else if(player.Number1 == 0)
				{
					return zeroStyle1;
				}
				else if (player.Number1 == 1)
				{
					return oneStyle1;
				}
				else if (player.Number2 == 0)
				{
					return zeroStyle2;
				}
				else 
				{
					return oneStyle2;
				}
			}
			return null;
		}
		public DataTemplate zeroStyle { get; set; }
		public DataTemplate oneStyle { get; set; }
		public DataTemplate zeroStyle1 { get; set; }
		public DataTemplate oneStyle1 { get; set; }
		public DataTemplate zeroStyle2 { get; set; }
		public DataTemplate oneStyle2 { get; set; }
	}
}
