-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
84 lines (81 loc) · 4.26 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<dx:ThemedWindow
x:Class="SchedulerDragDropExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SchedulerDragDropExample"
Width="800"
Height="600"
MinHeight="400"
mc:Ignorable="d"
Title="Navigate Command Example">
<dx:ThemedWindow.DataContext>
<local:MainViewModel/>
</dx:ThemedWindow.DataContext>
<Grid>
<!--region #SchedulerEvents-->
<dxsch:SchedulerControl x:Name="scheduler"
ActiveViewIndex="0"
AllowCellMultiSelect="False"
CommandBarStyle="Ribbon"
Start="{Binding SchedulerStart, Mode=OneTime}"
Loaded="{DXEvent Handler='InitDays(@e(scheduler))'}"
VisibleIntervalsChanged="{DXEvent Handler='OnVisibleIntervalsChanged(@sender, @args)'}">
<!--endregion #SchedulerEvents-->
<!--region #KeyToCommand-->
<dxmvvm:Interaction.Behaviors>
<dxmvvm:KeyToCommand Command="{DXCommand Execute='MyMoveLeft(@e(scheduler))'}" KeyGesture="Left" />
<dxmvvm:KeyToCommand Command="{DXCommand Execute='MyMoveRight(@e(scheduler))'}" KeyGesture="Right" />
</dxmvvm:Interaction.Behaviors>
<!--endregion #KeyToCommand-->
<dxsch:SchedulerControl.DataSource>
<dxsch:DataSource
AppointmentLabelsSource="{Binding PaymentStates}"
AppointmentsSource="{Binding Appointments}"
ResourcesSource="{Binding Doctors}">
<dxsch:DataSource.AppointmentMappings>
<dxsch:AppointmentMappings
AllDay="AllDay"
End="EndTime"
Id="Id"
LabelId="PaymentStateId"
Location="Location"
RecurrenceInfo="RecurrenceInfo"
Reminder="ReminderInfo"
ResourceId="DoctorId"
Start="StartTime"
Subject="PatientName"
Type="Type">
<dxsch:CustomFieldMapping Mapping="FirstVisit" Name="FirstVisit" />
<dxsch:CustomFieldMapping Mapping="Note" Name="Note" />
</dxsch:AppointmentMappings>
</dxsch:DataSource.AppointmentMappings>
<dxsch:DataSource.ResourceMappings>
<dxsch:ResourceMappings Caption="Name" Id="Id" />
</dxsch:DataSource.ResourceMappings>
<dxsch:DataSource.AppointmentLabelMappings>
<dxsch:AppointmentLabelMappings
Color="Color"
Caption="Caption"
Id="Id" />
</dxsch:DataSource.AppointmentLabelMappings>
</dxsch:DataSource>
</dxsch:SchedulerControl.DataSource>
<dxsch:DayView
x:Name="dayView1"
ShowWorkTimeOnly="True" />
<!--region #SchedulerControlCommands-->
<dxsch:SchedulerControl.Commands>
<dxsch:SchedulerCommands GoToDateCommand="{DXCommand Execute='MyGoToDate(@e(scheduler))'}"
GoToTodayCommand="{DXCommand Execute='MyGoToToday(@e(scheduler))'}"
NavigateViewBackwardCommand="{DXCommand Execute='MyNavigateBackward(@e(scheduler))'}"
NavigateViewForwardCommand="{DXCommand Execute='MyNavigateForward(@e(scheduler))'}" />
</dxsch:SchedulerControl.Commands>
<!--endregion #SchedulerControlCommands-->
</dxsch:SchedulerControl>
</Grid>
</dx:ThemedWindow>