This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/
MainWindow.xaml
67 lines (62 loc) · 3.54 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<Window x:Class="SchedulerBindToObservableCollectionWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
xmlns:local="clr-namespace:SchedulerBindToObservableCollectionWpf"
Title="MainWindow" Height="600" Width="800">
<Window.DataContext>
<local:SchedulerViewModel/>
</Window.DataContext>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<dxsch:SchedulerControl Name="schedulerControl1" GroupType="Resource" Grid.ColumnSpan="3">
<dxsch:SchedulerControl.Storage>
<dxsch:SchedulerStorage>
<dxsch:SchedulerStorage.AppointmentStorage>
<dxsch:AppointmentStorage DataSource="{Binding Appointments}" ResourceSharing="True">
<dxsch:AppointmentStorage.Mappings>
<dxsch:AppointmentMapping
Start="StartTime"
End="EndTime"
Subject="Subject"
Description="Description"
Location="Location"
AllDay="AllDay"
Label="Label"
Status="Status"
Type="EventType"
RecurrenceInfo="RecurrenceInfo"
ReminderInfo="ReminderInfo"
ResourceId="ResourceId"/>
</dxsch:AppointmentStorage.Mappings>
<dxsch:AppointmentStorage.CustomFieldMappings>
<dxsch:SchedulerCustomFieldMapping Member="Price" Name="cfPrice" ValueType="Decimal"/>
</dxsch:AppointmentStorage.CustomFieldMappings>
</dxsch:AppointmentStorage>
</dxsch:SchedulerStorage.AppointmentStorage>
<dxsch:SchedulerStorage.ResourceStorage>
<dxsch:ResourceStorage DataSource="{Binding Resources}">
<dxsch:ResourceStorage.Mappings>
<dxsch:ResourceMapping
Id="Id"
Caption="Name"
Color="Color"/>
</dxsch:ResourceStorage.Mappings>
</dxsch:ResourceStorage>
</dxsch:SchedulerStorage.ResourceStorage>
</dxsch:SchedulerStorage>
</dxsch:SchedulerControl.Storage>
</dxsch:SchedulerControl>
<Label Grid.Row="1" Content="Test methods:" HorizontalAlignment="Center" FontSize="20" Foreground="DarkBlue"/>
<Button Grid.Row="1" Grid.Column="1" Content="Add New Appointment" Command="{Binding AddNewAppointmentCommand}" />
<Button Grid.Row="1" Grid.Column="2" Content="Get Source Object" Command="{Binding GetSourceObjectCommand}" CommandParameter="{Binding ElementName=schedulerControl1, Path=Storage}" />
</Grid>
</Window>