using System;
using System.Collections.Generic;
using System.Linq;
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 System.Diagnostics;
using GridViewColumnSortState;

namespace _206846_RadGridView_RowStyle
{
	public partial class SilverlightControl1 : UserControl
	{
		public SilverlightControl1()
		{
			InitializeComponent();

			this.RadGridView1.DataLoaded += new EventHandler<EventArgs>(RadGridView1_DataLoaded);
			RadGridView1.ItemsSource = GetMessages();
		}

		private IList<Message> GetMessages()
		{
			return new Message[] { 
			new Message { Sender = "tom@hanna-barbera.com", Subject = "Cats are cool", Size = 100 },
			new Message { Sender = "jerry@hanna-barbera.com", Subject = "Mice are cool", Size = 100 },
			new Message { Sender = "spike@hanna-barbera.com", Subject = "Dogs are cool", Size = 100 }
			};
		}

		void RadGridView1_DataLoaded(object sender, EventArgs e)
		{
			foreach (var col in RadGridView1.Columns)
			{
				col.HeaderCellStyle = (Style)this.Resources["GridViewHeaderCellStyle"];
			}
		}
	}
}
