-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
102 lines (96 loc) · 5.4 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
93
94
95
96
97
98
99
100
101
102
<Window
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CustomizeAppointmentExample"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxschc="http://schemas.devexpress.com/winfx/2008/xaml/scheduling/common"
xmlns:dxschv="http://schemas.devexpress.com/winfx/2008/xaml/scheduling/visual"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
x:Class="CustomizeAppointmentExample.MainWindow"
Height="600" MinHeight="400"
Width="800"
mc:Ignorable="d"
dx:ThemeManager.ThemeName="Office2019White"
DataContext="{dxmvvm:ViewModelSource {x:Type local:MainViewModel}}"
Title="Custom Appointment Appearance Example">
<Window.Resources>
<!--region #AppointmentContentTemplate-->
<DataTemplate x:Key="appointmentContentTemplate">
<dxschv:AppointmentContentPanel>
<dxschv:AppointmentContentPanel.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0, 1">
<GradientStop Color="White" Offset="0" />
<GradientStop Color="Transparent" Offset="0.5" />
</LinearGradientBrush>
</dxschv:AppointmentContentPanel.Background>
<dxschv:AppointmentContentPanel.IntervalSubject>
<dxschv:AppointmentIntervalSubjectPresenter/>
</dxschv:AppointmentContentPanel.IntervalSubject>
<dxschv:AppointmentContentPanel.Location>
<dxschv:AppointmentLocationPresenter FontWeight="Normal" Foreground="Blue" />
</dxschv:AppointmentContentPanel.Location>
<dxschv:AppointmentContentPanel.Description>
<StackPanel>
<dxschv:FastTextBlock Text="{Binding Appointment.CustomFields[Note]}" FontWeight="Normal" Foreground="Red"/>
<dxschv:AppointmentDescriptionPresenter FontWeight="Normal" Margin="0,1,0,0" WordWrap="True"/>
</StackPanel>
</dxschv:AppointmentContentPanel.Description>
<dxschv:AppointmentContentPanel.Images>
<dxschv:AppointmentImagesPanel/>
</dxschv:AppointmentContentPanel.Images>
</dxschv:AppointmentContentPanel>
</DataTemplate>
<!--endregion #AppointmentContentTemplate-->
<!--region #AppointmentControlStyle-->
<DataTemplate x:Key="myImageBox">
<Image Margin="2" Height="16" Width="16"
Source="{Binding Appointment.CustomFields[FirstVisit], Converter={local:ConditionToImageSourceConverter}}" />
</DataTemplate>
<Style x:Key="appointmentStyle" TargetType="dxschv:AppointmentControl">
<Setter Property="ShowInterval" Value="True"/>
<Setter Property="ShowDescription" Value="True"/>
<Setter Property="ImageBoxTemplate" Value="{StaticResource myImageBox}"/>
</Style>
<!--endregion #AppointmentControlStyle-->
</Window.Resources>
<Grid>
<dxsch:SchedulerControl >
<dxsch:SchedulerControl.DataSource>
<dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Doctors}">
<dxsch:DataSource.AppointmentMappings>
<dxsch:AppointmentMappings AllDay="AllDay"
Id="Id"
End="EndTime"
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>
</dxsch:SchedulerControl.DataSource>
<!--region #ApplyAppointmentContentTemplate-->
<dxsch:DayView AppointmentContentTemplate="{StaticResource appointmentContentTemplate}"
AppointmentStyle="{StaticResource appointmentStyle}"
ShowAllDayArea="False"
ShowWorkTimeOnly="True"
DayCount="3"/>
<dxsch:WorkWeekView AppointmentContentTemplate="{StaticResource appointmentContentTemplate}"
ShowWorkTimeOnly="True" />
<!--endregion #ApplyAppointmentContentTemplate-->
<dxsch:WeekView />
<dxsch:MonthView />
</dxsch:SchedulerControl>
</Grid>
</Window>