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 C1.Silverlight.Schedule;
using C1.C1Schedule;
using C1.Silverlight;
using System.ComponentModel;

namespace ClearStyle
{
    public partial class MainPage : UserControl, INotifyPropertyChanged, IDisposable
    {

        public MainPage()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            // update toolbar buttons state
            sched1_StyleChanged(null, null);
        }
        
        private void sched1_StyleChanged(object sender, RoutedEventArgs e)
        {
            // update toolbar buttons state according to the current C1Scheduler view
            if (sched1.Style == sched1.WorkingWeekStyle)
            {
                btnWorkWeek.IsChecked = true;
            }
            else if (sched1.Style == sched1.WeekStyle)
            {
                btnWeek.IsChecked = true;
            }
            else if (sched1.Style == sched1.MonthStyle)
            {
                btnMonth.IsChecked = true;
            }
            else if (sched1.Style == sched1.OneDayStyle)
            {
                btnDay.IsChecked = true;
            }
            else
            {
                btnTimeLine.IsChecked = true;
            }
        }

        public Brush DEMO_Background
        {
            get
            {
                return sched1.Background;
            }
            set
            {
                sched1.Background = value;
            }
        }

        public Brush DEMO_Foreground
        {
            get
            {
                return sched1.Foreground;
            }
            set
            {
                sched1.Foreground = value;
            }
        }

        public Brush DEMO_BorderBrush
        {
            get
            {
                return sched1.BorderBrush;
            }
            set
            {
                sched1.BorderBrush = value;
            }
        }

        public Thickness DEMO_BorderThickness
        {
            get
            {
                return sched1.BorderThickness;
            }
            set
            {
                sched1.BorderThickness = value;
            }
        }

        public Brush TodayBackground
        {
            get
            {
                return sched1.TodayBackground;
            }
            set
            {
                sched1.TodayBackground = value;
            }
        }

        public Brush ControlBackground
        {
            get
            {
                return sched1.ControlBackground;
            }
            set
            {
                sched1.ControlBackground = value;
            }
        }

        public Brush ControlForeground
        {
            get
            {
                return sched1.ControlForeground;
            }
            set
            {
                sched1.ControlForeground = value;
            }
        }

        public Brush AppointmentForeground
        {
            get
            {
                return sched1.AppointmentForeground;
            }
            set
            {
                sched1.AppointmentForeground = value;
            }
        }

        public Brush AlternatingBackground
        {
            get
            {
                return sched1.AlternatingBackground;
            }
            set
            {
                sched1.AlternatingBackground = value;
            }
        }

        public Brush SelectedBackground
        {
            get
            {
                return sched1.SelectedBackground;
            }
            set
            {
                sched1.SelectedBackground = value;
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region IDisposable Members

        public void Dispose()
        {
            sched1.Dispose();
        }

        #endregion
    }
}
