using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Pivot.DataProviders;

namespace RadPivotGrid_SL_618382
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            IList<EmployeeData> listOfData = new List<EmployeeData>()
            {
                new EmployeeData { Name = "John Doe", Hours = 9.0, Date = new DateTime (2012,10,20) },
                new EmployeeData { Name = "John Doe", Hours = 8.25, Date = new DateTime (2012,10,21) },
                new EmployeeData { Name = "John Doe", Hours = 8.0, Date = new DateTime (2012,10,22) },
                new EmployeeData { Name = "John Doe", Hours = 8.0, Date = new DateTime (2012,10,23) },
                new EmployeeData { Name = "John Doe", Hours = 8.0, Date = new DateTime (2012,10,24) },

                new EmployeeData { Name = "Jane Doe", Hours = 7.0, Date = new DateTime (2012,10,20) },
                new EmployeeData { Name = "Jane Doe", Hours = 9.25, Date = new DateTime (2012,10,21) },
                new EmployeeData { Name = "Jane Doe", Hours = 7.5, Date = new DateTime (2012,10,22) },
                new EmployeeData { Name = "Jane Doe", Hours = 7.5, Date = new DateTime (2012,10,23) },
                new EmployeeData { Name = "Jane Doe", Hours = 7.5, Date = new DateTime (2012,10,24) },

                new EmployeeData { Name = "Jack Doe", Hours = 4.0, Date = new DateTime (2012,10,20) },
                new EmployeeData { Name = "Jack Doe", Hours = 5.25, Date = new DateTime (2012,10,21) },
                new EmployeeData { Name = "Jack Doe", Hours = 3.25, Date = new DateTime (2012,10,22) },
                new EmployeeData { Name = "Jack Doe", Hours = 5.25, Date = new DateTime (2012,10,23) },
                new EmployeeData { Name = "Jack Doe", Hours = 3.25, Date = new DateTime (2012,10,24) },

                new EmployeeData { Name = "Jim Doe", Hours = 4.0, Date = new DateTime (2012,10,20) },
                new EmployeeData { Name = "Jim Doe", Hours = 5.25, Date = new DateTime (2012,10,21) },
                new EmployeeData { Name = "Jim Doe", Hours = 3.25, Date = new DateTime (2012,10,22) },
                new EmployeeData { Name = "Jim Doe", Hours = 5.25, Date = new DateTime (2012,10,23) },
                new EmployeeData { Name = "Jim Doe", Hours = 3.25, Date = new DateTime (2012,10,24) },
            };

            LocalDataSourceProvider dataProvider = this.Resources["data"] as LocalDataSourceProvider;
            dataProvider.ItemsSource = listOfData;

            this.FieldList.DataProvider = dataProvider;
            this.Pivot.DataProvider = dataProvider;

            this.BusyIndicator.IsBusy = false;
        }
    }
}
