/
MainWindow.xaml
92 lines (89 loc) · 4.75 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
85
86
87
88
89
90
91
92
<Window
x:Class="SchedulerDragDropResizeExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling"
xmlns:local="clr-namespace:SchedulerDragDropResizeExample"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
Width="800"
Height="600"
MinHeight="400"
mc:Ignorable="d"
DataContext="{dxmvvm:ViewModelSource {x:Type local:MainViewModel}}"
Title="Scheduler Drag Drop Example">
<DockPanel>
<dx:GroupFrame Header="Action Modes" DockPanel.Dock="Top">
<dxlc:LayoutControl
VerticalAlignment="Top"
HorizontalAlignment="Left"
Orientation="Horizontal">
<dxlc:LayoutItem Label="Drag: " Padding="5">
<dxe:ComboBoxEdit Width="120"
EditValue="{DXBinding '@ElementName(scheduler).AppointmentDragMode', UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{dxe:EnumItemsSource EnumType=dxsch:AppointmentDragResizeMode}" />
</dxlc:LayoutItem>
<dxlc:LayoutItem Label="Resize: " Padding="5">
<dxe:ComboBoxEdit Width="120"
EditValue="{DXBinding '@ElementName(scheduler).AppointmentResizeMode', UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{dxe:EnumItemsSource EnumType=dxsch:AppointmentDragResizeMode}" />
</dxlc:LayoutItem>
</dxlc:LayoutControl>
</dx:GroupFrame>
<dxsch:SchedulerControl x:Name="scheduler" GroupType="Resource" AppointmentDragMode="Precise">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand
Command="{Binding OnAppointmentDragCommand}"
EventName="AppointmentDrag"
PassEventArgsToCommand="True" />
<dxmvvm:EventToCommand
Command="{Binding OnAppointmentDropCommand}"
EventName="AppointmentDrop"
PassEventArgsToCommand="True" />
<dxmvvm:EventToCommand
Command="{Binding OnAppointmentResizeCommand}"
EventName="AppointmentResize"
PassEventArgsToCommand="True" />
</dxmvvm:Interaction.Behaviors>
<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="FixedTime" Name="FixedTime" />
<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 ResourcesPerPage="3" ShowWorkTimeOnly="True" SnapToCellsMode="Never" />
<dxsch:MonthView />
</dxsch:SchedulerControl>
</DockPanel>
</Window>