<Window x:Class="BusinessObjectsBinding.Window1" Title="Business Objects Binding" Height="600" Width="800" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:c1sched="http://schemas.componentone.com/winfx/2006/xaml" 
        xmlns:local="clr-namespace:BusinessObjectsBinding">
	<DockPanel>
		<ToolBar DockPanel.Dock="Top">
			<Button Click="ButtonAdd_Click" ToolTip="Adds a new AppointmentBusinessObject to the Appointments list.">Add New</Button>
			<Button Click="ButtonClear_Click" ToolTip="Clears the Appointments list.">Clear</Button>
            <Separator />
            <RadioButton x:Name="btnDay" Content="Day" CommandTarget="{Binding ElementName=scheduler1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=OneDayStyle, ElementName=scheduler1}" />
            <RadioButton x:Name="btnWorkWeek" Content="Work Week" CommandTarget="{Binding ElementName=scheduler1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=WorkingWeekStyle, ElementName=scheduler1}" />
            <RadioButton x:Name="btnWeek" Content="Week" CommandTarget="{Binding ElementName=scheduler1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=WeekStyle, ElementName=scheduler1}" />
            <RadioButton x:Name="btnMonth" Content="Month" CommandTarget="{Binding ElementName=scheduler1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=MonthStyle, ElementName=scheduler1}" />
            <RadioButton x:Name="btnTimeLine" Content="Time Line" CommandTarget="{Binding ElementName=scheduler1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=TimeLineStyle, ElementName=scheduler1}" />
        </ToolBar>
        <c1sched:C1Calendar x:Name="calendar" DockPanel.Dock="Top" Height="175" HorizontalAlignment="Stretch" SelectedDates="{Binding Path=VisibleDates, ElementName=scheduler1, Mode=OneWay}" MaxSelectionCount="35" BoldedDates="{Binding Path=BoldedDates, ElementName=scheduler1, Mode=Default}" />
        <c1sched:C1Scheduler x:Name="scheduler1" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=c1sched:C1Scheduler, ResourceId=WeekStyle}}" BorderBrush="CadetBlue" BorderThickness="0,2,0,0" Theme="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=c1sched:C1Scheduler, ResourceId=Office2007.Blue}}" >
				<!-- Map AppointmentStorage -->
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.AppointmentProperties.MappingName" Value="Properties" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.Body.MappingName" Value="Body" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.End.MappingName" Value="End" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.IdMapping.MappingName" Value="Id" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.Location.MappingName" Value="Location" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.Start.MappingName" Value="Start" />
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.Mappings.Subject.MappingName" Value="Subject" />
				<!-- Bind AppointmentStorage.DataSource to the Window1.Appointments property -->
            <c1sched:NestedPropertySetter PropertyName="DataStorage.AppointmentStorage.DataSource" Value="{Binding Path=Appointments, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type local:Window1}}}" />

        </c1sched:C1Scheduler>
	</DockPanel>
</Window>