C1Scheduler Task-Based Help > C1Scheduler Tasks > Linking a Scheduler to a Calendar |
The following topic explains how to bind a schedule to a C1Calendar control in Microsoft Blend, Visual Studio, and using XAML.
Using Microsoft Blend
In Blend, linking C1Scheduler to one of the calendar controls is as easy as setting a property.
{Binding Path=SelectedDateTime, ElementName=C1Scheduler1, Mode=TwoWay}
This will bind the selected date of the calendar to the schedule.
The equivalent XAML code can be viewed by clicking the XAML view tab. It should look like the following:
XAML |
Copy Code
|
---|---|
c1:C1Calendar HorizontalAlignment="Left" VerticalAlignment="Top" Theme="{DynamicResource {ComponentResourceKey ResourceId=Default, TypeInTargetAssembly={x:Type c1sched:CalendarBase}}}" SelectedDate="{Binding SelectedDateTime, ElementName=C1Scheduler1, Mode=TwoWay}"> |
Press F5 to run the project and select a date in the calendar. The schedules selected date will change accordingly.
Using Visual Studio
To link C1Scheduler to a C1Calendar control:
<c1:C1Calendar HorizontalAlignment="Left" Margin="34,51,0,0" Name="c1Calendar1" VerticalAlignment="Top" SelectedDate="{Binding Path=SelectedDateTime, ElementName=C1Scheduler1, Mode=TwoWay}" />
Using XAML
The following XAML binds C1Scheduler to a C1Calendar control:
<c1:C1Calendar HorizontalAlignment="Left" Margin="34,51,0,0" Name="c1Calendar1" VerticalAlignment="Top" SelectedDate="{Binding Path=SelectedDateTime, ElementName=C1Scheduler1, Mode=TwoWay}" />