-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
133 lines (123 loc) · 6.44 KB
/
MainWindow.xaml
File metadata and controls
133 lines (123 loc) · 6.44 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<Window x:Class="AppearanceCustomization.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:AppearanceCustomization"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:skinmanager ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"
skinmanager:SfSkinManager.VisualStyle="MaterialLight"
mc:Ignorable="d"
Title="AppearanceCustomization Demo"
Icon="App.ico"
WindowStartupLocation="CenterScreen">
<Window.DataContext>
<local:SchedulerViewModel/>
</Window.DataContext>
<Window.Resources>
<ObjectDataProvider x:Key="schedulerViewTypes" MethodName="GetValues"
ObjectType="{x:Type system:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type Type="{x:Type syncfusion:SchedulerViewType}"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<local:SubjectToImageSourceConverter x:Key="subjectToImageConverter"/>
<DataTemplate x:Key="appointmentTemplate">
<StackPanel Background="{Binding Background}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Orientation="Horizontal">
<Image x:Name="Image"
VerticalAlignment="Center"
Height="30"
Width="15"
Margin="5,0"
Source="{Binding Converter={StaticResource subjectToImageConverter}, Path=EventName}">
</Image>
<TextBlock Margin="5"
VerticalAlignment="Center"
Text="{Binding EventName}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap"
TextAlignment="Left"
FontWeight="Bold"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="allDayAppointmentTemplate">
<StackPanel Background="{Binding Background}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Orientation="Horizontal">
<Image x:Name="Image"
VerticalAlignment="Top"
Height="20"
Width="15"
Margin="5,2,0,0"
Source="{Binding Converter={StaticResource subjectToImageConverter}, Path=EventName}">
</Image>
<TextBlock Margin="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Text="{Binding EventName}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap"
FontWeight="SemiBold"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="monthAppointmentTemplate">
<StackPanel Background="{Binding Background}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Orientation="Horizontal">
<Image x:Name="Image"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Height="12"
Width="15"
Margin="5,2,0,0"
Source="{Binding Converter={StaticResource subjectToImageConverter}, Path=EventName}">
</Image>
<TextBlock Margin="5,2,0,0"
FontSize="10"
HorizontalAlignment="Stretch"
Text="{Binding EventName}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap"
FontWeight="Heavy"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<syncfusion:SfScheduler x:Name="Schedule"
ViewType="{Binding ElementName=viewTypeComboBox, Path=SelectedValue}"
ItemsSource="{Binding Appointments}">
<syncfusion:SfScheduler.MonthViewSettings>
<syncfusion:MonthViewSettings AppointmentDisplayMode="Appointment"
AppointmentTemplate="{StaticResource monthAppointmentTemplate}">
</syncfusion:MonthViewSettings>
</syncfusion:SfScheduler.MonthViewSettings>
<syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:DaysViewSettings AppointmentTemplate="{StaticResource appointmentTemplate}"
AllDayAppointmentTemplate="{StaticResource allDayAppointmentTemplate}"/>
</syncfusion:SfScheduler.DaysViewSettings>
<syncfusion:SfScheduler.TimelineViewSettings>
<syncfusion:TimelineViewSettings AppointmentTemplate="{StaticResource appointmentTemplate}"/>
</syncfusion:SfScheduler.TimelineViewSettings>
<syncfusion:SfScheduler.AppointmentMapping>
<syncfusion:AppointmentMapping StartTime="From"
EndTime="To"
Subject="EventName"
AppointmentBackground="Background"
IsAllDay="IsAllDay"/>
</syncfusion:SfScheduler.AppointmentMapping>
</syncfusion:SfScheduler>
<StackPanel
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,20,25,0">
<ComboBox x:Name="viewTypeComboBox" ItemsSource="{Binding Source={StaticResource schedulerViewTypes}}"
SelectedIndex="2" Width="100"/>
</StackPanel>
</Grid>
</Window>