/
MainWindow.xaml
70 lines (68 loc) · 3.24 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
<Window
x:Class="ColorMappingExample.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ColorMappingExample"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:viewmodels="clr-namespace:ColorMappingExample.ViewModels"
Height="600"
Width="800"
mc:Ignorable="d"
DataContext="{dxmvvm:ViewModelSource viewmodels:MainViewModel}"
Title="MainWindow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="480*" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0">
<dxe:PopupColorEdit
Height="Auto"
Width="Auto"
Margin="10,10,10,10"
Color="{Binding ElementName = scheduler, Path= LabelItems[1].Color ,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock
Margin="10,10,10,10"
VerticalAlignment="Center"
Text= "{Binding Categories[1].ColorDataInfo}" />
</WrapPanel>
<dxsch:SchedulerControl x:Name="scheduler" Grid.Row="1">
<dxsch:SchedulerControl.DataSource>
<dxsch:DataSource AppointmentLabelsSource="{Binding Categories}" AppointmentsSource="{Binding Appointments}">
<dxsch:DataSource.AppointmentMappings>
<dxsch:AppointmentMappings
AllDay="AllDay"
End="EndTime"
LabelId="CategoryId"
Location="Location"
RecurrenceInfo="RecurrenceInfo"
Reminder="ReminderInfo"
Start="StartTime"
StatusId="StatusId"
Subject="Subject"
Type="Type" />
</dxsch:DataSource.AppointmentMappings>
<!--region #AppointmentLabelMappings-->
<dxsch:DataSource.AppointmentLabelMappings>
<dxsch:AppointmentLabelMappings Color="{dxsch:Mapping FieldName=ColorData,
ConversionBehavior=BetweenFieldAndMapping,
Converter= {local:HtmlColorCodeToHexConverter}}"
Caption="Caption"
ColorSavingType="ColorString"
Id="Id" />
</dxsch:DataSource.AppointmentLabelMappings>
<!--endregion #AppointmentLabelMappings-->
</dxsch:DataSource>
</dxsch:SchedulerControl.DataSource>
<dxsch:DayView
x:Name="dayView1"
DayCount="2"
ShowWorkTimeOnly="True" />
</dxsch:SchedulerControl>
</Grid>
</Window>