using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;
using Samples.Shared;
using Telerik.Windows.Controls;

namespace Samples.GridView.HeaderImages
{
    /// <summary>
    /// Interaction logic for MainPage.xaml
    /// </summary>
    public partial class MainPage : UserControl
    {
        private bool changingSelection;

        public MainPage()
        {
            InitializeComponent();

            this.radGridView.ItemsSource = SampleData.GetMessages();
            this.CreateSecondImageInHeader();
        }

        private void CreateSecondImageInHeader()
        {
            GridViewDataColumn column = new GridViewDataColumn();
            column.DataMemberBinding = new Binding("Size");

            Image image = new Image() { Height=40, Width=40 };
            image.Source = new BitmapImage(new Uri(@"/Content/Images/green.png", UriKind.RelativeOrAbsolute));
            column.Header = image;

            this.radGridView.Columns.Add(column);
        }
    }
}
