Imports System.Net
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Imports C1.Silverlight.Schedule
Imports C1.C1Schedule
Imports C1.Silverlight
Imports System.ComponentModel

Namespace ClearStyle
	Partial Public Class MainPage
		Inherits UserControl
		Implements INotifyPropertyChanged, IDisposable

		Public Sub New()
			InitializeComponent()
		End Sub

		Private Sub UserControl_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
			' update toolbar buttons state
			sched1_StyleChanged(Nothing, Nothing)
		End Sub

		Private Sub sched1_StyleChanged(ByVal sender As Object, ByVal e As RoutedEventArgs)
			' update toolbar buttons state according to the current C1Scheduler view
            If sched1.Style Is sched1.WorkingWeekStyle Then
                btnWorkWeek.IsChecked = True
            ElseIf sched1.Style Is sched1.WeekStyle Then
                btnWeek.IsChecked = True
            ElseIf sched1.Style Is sched1.MonthStyle Then
                btnMonth.IsChecked = True
            ElseIf sched1.Style Is sched1.OneDayStyle Then
                btnDay.IsChecked = True
            Else
                btnTimeLine.IsChecked = True
            End If
		End Sub

		Public Property DEMO_Background() As Brush
			Get
				Return sched1.Background
			End Get
			Set(ByVal value As Brush)
				sched1.Background = value
			End Set
		End Property

		Public Property DEMO_Foreground() As Brush
			Get
				Return sched1.Foreground
			End Get
			Set(ByVal value As Brush)
				sched1.Foreground = value
			End Set
		End Property

		Public Property DEMO_BorderBrush() As Brush
			Get
				Return sched1.BorderBrush
			End Get
			Set(ByVal value As Brush)
				sched1.BorderBrush = value
			End Set
		End Property

		Public Property DEMO_BorderThickness() As Thickness
			Get
				Return sched1.BorderThickness
			End Get
			Set(ByVal value As Thickness)
				sched1.BorderThickness = value
			End Set
		End Property

		Public Property TodayBackground() As Brush
			Get
				Return sched1.TodayBackground
			End Get
			Set(ByVal value As Brush)
				sched1.TodayBackground = value
			End Set
		End Property

		Public Property ControlBackground() As Brush
			Get
				Return sched1.ControlBackground
			End Get
			Set(ByVal value As Brush)
				sched1.ControlBackground = value
			End Set
		End Property

		Public Property ControlForeground() As Brush
			Get
				Return sched1.ControlForeground
			End Get
			Set(ByVal value As Brush)
				sched1.ControlForeground = value
			End Set
		End Property

		Public Property AppointmentForeground() As Brush
			Get
				Return sched1.AppointmentForeground
			End Get
			Set(ByVal value As Brush)
				sched1.AppointmentForeground = value
			End Set
		End Property

		Public Property AlternatingBackground() As Brush
			Get
				Return sched1.AlternatingBackground
			End Get
			Set(ByVal value As Brush)
				sched1.AlternatingBackground = value
			End Set
		End Property

		Public Property SelectedBackground() As Brush
			Get
				Return sched1.SelectedBackground
			End Get
			Set(ByVal value As Brush)
				sched1.SelectedBackground = value
			End Set
		End Property

		#Region "INotifyPropertyChanged Members"

		Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged

		#End Region

		#Region "IDisposable Members"

		Public Sub Dispose() Implements IDisposable.Dispose
			sched1.Dispose()
		End Sub

		#End Region
	End Class
End Namespace
