using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.TimeBar;

namespace RadTB.Features
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            RadAreaSparkline sparkline = new RadAreaSparkline();
            Random r = new Random();
            List<int> data = new List<int>();
            for (DateTime currentDate = DateTime.Today; currentDate < DateTime.Today.AddDays( 100 );
               currentDate = currentDate.AddDays( 1 ))
            {
                data.Add( r.Next( 0, 60 ) );
            }
            sparkline.ItemsSource = data;

            RadTimeBar timebar = new RadTimeBar();
            timebar.BeginInit();
            timebar.Width = 950;
            timebar.Height = 250;
            timebar.PeriodStart = new DateTime( 2010, 1, 1 );
            timebar.PeriodEnd = new DateTime( 2013, 12, 31 );
            timebar.VisiblePeriodStart = new DateTime( 2011, 2, 14 );
            timebar.VisiblePeriodEnd = new DateTime( 2012, 6, 1 );
            timebar.SelectionStart = new DateTime( 2011, 7, 4 );
            timebar.SelectionEnd = new DateTime( 2011, 8, 5 );
            timebar.IsSnapToIntervalEnabled = true;
            timebar.Intervals.Add( new MonthInterval() );
            timebar.Intervals.Add( new WeekInterval() );
            timebar.Intervals.Add( new DayInterval() );
            timebar.EndInit();
            timebar.Content = sparkline;
            this.Content = timebar;
        }
    }
}