Calendar.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <UserControl x:Class="PRSDesktop.Calendar"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PRSDesktop"
  7. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  8. xmlns:dynamicGrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
  9. mc:Ignorable="d"
  10. d:DesignHeight="600" d:DesignWidth="800" SizeChanged="Calendar_OnSizeChanged">
  11. <UserControl.Resources>
  12. <Style TargetType="syncfusion:TimeRulerCell">
  13. <Setter Property='VerticalContentAlignment' Value="Center" />
  14. </Style>
  15. <Style TargetType="syncfusion:AppointmentControl">
  16. <Setter Property="BorderBrush" Value="DimGray" />
  17. <Setter Property="SelectionBorderBrush" Value="Red"/>
  18. <Setter Property="BorderThickness" Value="0.75"/>
  19. <Setter Property="Margin" Value="0,0,-8,0"/>
  20. </Style>
  21. </UserControl.Resources>
  22. <dynamicGrid:DynamicSplitPanel
  23. x:Name="_splitPanel"
  24. Anchor="Detail"
  25. AnchorWidth="200"
  26. AllowableViews="Master,Combined"
  27. View="Combined"
  28. DetailCaption="Settings"
  29. OnChanged="_splitPanel_OnOnChanged">
  30. <dynamicGrid:DynamicSplitPanel.Master>
  31. <local:SfScheduler2
  32. x:Name="Bookings"
  33. HeaderDateFormat="dd MMMM yyyy"
  34. SizeChanged="Schedule_SizeChanged"
  35. AppointmentEditorOpening="Schedule_AppointmentEditorOpening"
  36. SchedulerContextMenuOpening="Bookings_OnSchedulerContextMenuOpening"
  37. AppointmentTapped="Bookings_OnAppointmentTapped"
  38. ViewType="Day"
  39. BorderThickness="1"
  40. BorderBrush="Silver"
  41. Background="Silver"
  42. ResourceGroupType="Date"
  43. FirstDayOfWeek="Monday"
  44. >
  45. <!-- <syncfusion:SfScheduler.HeaderTemplate> -->
  46. <!-- <DataTemplate> -->
  47. <!-- <Border BorderBrush="Transparent" Background="Transparent" Height="0" Width="200"/> -->
  48. <!-- </DataTemplate> -->
  49. <!-- </syncfusion:SfScheduler.HeaderTemplate> -->
  50. <syncfusion:SfScheduler.CellContextMenu>
  51. <ContextMenu />
  52. </syncfusion:SfScheduler.CellContextMenu>
  53. <syncfusion:SfScheduler.AppointmentContextMenu>
  54. <ContextMenu />
  55. </syncfusion:SfScheduler.AppointmentContextMenu>
  56. <syncfusion:SfScheduler.DaysViewSettings>
  57. <syncfusion:DaysViewSettings ViewHeaderDateFormat="dd MMM yy" ViewHeaderDayFormat="dddd"
  58. ViewHeaderHeight="45" TimeRulerFormat="hh:mm tt" TimeInterval="0:30"
  59. MinimumAllDayAppointmentsCount="0">
  60. <syncfusion:DaysViewSettings.ViewHeaderTemplate>
  61. <DataTemplate>
  62. <StackPanel Background="WhiteSmoke" Margin="-10,0,0,0" VerticalAlignment="Stretch"
  63. HorizontalAlignment="Stretch" Orientation="Vertical">
  64. <Label HorizontalContentAlignment="Center" Content="{Binding DayText}" FontSize="12"
  65. Foreground="Black" FontFamily="Arial" FontWeight="Bold"
  66. VerticalContentAlignment="Bottom" Margin="0,0,0,-5" />
  67. <Label HorizontalContentAlignment="Center" Content="{Binding DateText}" FontSize="10"
  68. VerticalContentAlignment="Top" />
  69. </StackPanel>
  70. </DataTemplate>
  71. </syncfusion:DaysViewSettings.ViewHeaderTemplate>
  72. <syncfusion:DaysViewSettings.AppointmentTemplate>
  73. <DataTemplate>
  74. <Border BorderThickness="0" Background="{Binding AppointmentBackground}" Padding="2" CornerRadius="2">
  75. <!-- <Border.ToolTip> -->
  76. <!-- <local:CalendarBlock DataContext="{Binding}" /> -->
  77. <!-- </Border.ToolTip> -->
  78. <local:CalendarBlock DataContext="{Binding}" />
  79. </Border>
  80. </DataTemplate>
  81. </syncfusion:DaysViewSettings.AppointmentTemplate>
  82. </syncfusion:DaysViewSettings>
  83. </syncfusion:SfScheduler.DaysViewSettings>
  84. </local:SfScheduler2>
  85. </dynamicGrid:DynamicSplitPanel.Master>
  86. <dynamicGrid:DynamicSplitPanel.Detail>
  87. <Grid>
  88. <Grid.ColumnDefinitions>
  89. <ColumnDefinition Width="Auto" />
  90. <ColumnDefinition Width="*" />
  91. </Grid.ColumnDefinitions>
  92. <Grid.RowDefinitions>
  93. <RowDefinition Height="Auto" />
  94. <RowDefinition Height="*" />
  95. <RowDefinition Height="Auto" />
  96. <RowDefinition Height="Auto" />
  97. <RowDefinition Height="Auto" />
  98. <RowDefinition Height="Auto" />
  99. <RowDefinition Height="Auto" />
  100. <RowDefinition Height="Auto" />
  101. </Grid.RowDefinitions>
  102. <DockPanel
  103. Grid.Row="0"
  104. Grid.Column="0"
  105. Grid.ColumnSpan="2">
  106. <Button
  107. x:Name="_settingsButton"
  108. DockPanel.Dock="Left"
  109. Click="_settingsButton_OnClick"
  110. Background="WhiteSmoke"
  111. BorderBrush="Gray"
  112. BorderThickness="0.75"
  113. Height="25"
  114. Width="25"
  115. Padding="2">
  116. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  117. </Button>
  118. <ComboBox
  119. x:Name="CalendarViewSelector"
  120. DockPanel.Dock="Left"
  121. SelectionChanged="CalendarViewSelector_SelectionChanged"
  122. VerticalContentAlignment="Center"
  123. SelectedIndex="-1"
  124. Margin="5,0,0,0">
  125. <ComboBoxItem Content="Day" />
  126. <ComboBoxItem Content="Work Week" />
  127. <ComboBoxItem Content="Week" />
  128. </ComboBox>
  129. </DockPanel>
  130. <local:EmployeeSelector
  131. x:Name="EmployeeSelector"
  132. Grid.Row="1"
  133. Grid.Column="0"
  134. Grid.ColumnSpan="2"
  135. Margin="-5,5,0,0"
  136. SettingsChanged="EmployeeSelector_OnSettingsChanged"
  137. SelectionChanged="EmployeeSelector_OnSelectionChanged"/>
  138. <Label
  139. Grid.Row="2"
  140. Grid.Column="0"
  141. VerticalContentAlignment="Center"
  142. Margin="0,5,0,0"
  143. Content="Start" />
  144. <DockPanel
  145. Grid.Row="2"
  146. Grid.Column="1"
  147. Margin="5,5,0,0">
  148. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  149. BorderBrush="Gray" Click="StartTimeSelector_Down_Click">
  150. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  151. </Button>
  152. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  153. BorderBrush="Gray" Click="StartTimeSelector_Up_Click">
  154. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  155. </Button>
  156. <TextBox x:Name="StartTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  157. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  158. </DockPanel>
  159. <Label
  160. Grid.Row="3"
  161. Grid.Column="0"
  162. VerticalContentAlignment="Center"
  163. Margin="0,5,0,0"
  164. Content="Finish"/>
  165. <DockPanel
  166. Grid.Row="3"
  167. Grid.Column="1"
  168. Margin="5,5,0,0">
  169. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  170. BorderBrush="Gray" Click="FinishTimeSelector_Down_Click">
  171. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  172. </Button>
  173. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  174. BorderBrush="Gray" Click="FinishTimeSelector_Up_Click">
  175. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  176. </Button>
  177. <TextBox x:Name="FinishTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  178. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  179. </DockPanel>
  180. <Label
  181. Grid.Row="4"
  182. Grid.Column="0"
  183. VerticalContentAlignment="Center"
  184. Margin="0,5,0,0"
  185. Content="Assignments" />
  186. <ComboBox
  187. x:Name="AssignmentTypeSelector"
  188. Grid.Row="4"
  189. Grid.Column="1"
  190. SelectedIndex="0"
  191. Margin="5,5,0,0"
  192. SelectionChanged="AssignmentTypeSelector_OnSelectionChanged"
  193. VerticalContentAlignment="Center">
  194. <ComboBoxItem Content="Automatic" />
  195. <ComboBoxItem Content="Booked Time" />
  196. <ComboBoxItem Content="Actual Time" />
  197. </ComboBox>
  198. <Label
  199. Grid.Row="5"
  200. Grid.Column="0"
  201. VerticalContentAlignment="Center"
  202. Margin="0,5,0,0"
  203. Content="Background" />
  204. <ComboBox
  205. x:Name="BackgroundTypeSelector"
  206. Grid.Row="5"
  207. Grid.Column="1"
  208. SelectedIndex="0"
  209. Margin="5,5,0,0"
  210. SelectionChanged="BackgroundTypeSelector_OnSelectionChanged"
  211. VerticalContentAlignment="Center">
  212. <ComboBoxItem Content="Automatic" />
  213. <ComboBoxItem Content="Rosters" />
  214. <ComboBoxItem Content="Timesheets" />
  215. </ComboBox>
  216. <Label
  217. Grid.Row="6"
  218. Grid.Column="0"
  219. VerticalContentAlignment="Center"
  220. Margin="0,5,0,0"
  221. Content="Interval"/>
  222. <ComboBox
  223. x:Name="IntervalSelector"
  224. Grid.Row="6"
  225. Grid.Column="1"
  226. SelectedIndex="0"
  227. Margin="5,5,0,0"
  228. SelectionChanged="IntervalSelector_OnSelectionChanged"
  229. VerticalContentAlignment="Center">
  230. <ComboBoxItem Content="Five Minutes" />
  231. <ComboBoxItem Content="Six Minutes" />
  232. <ComboBoxItem Content="Ten Minutes" />
  233. <ComboBoxItem Content="Fifteen Minutes" />
  234. <ComboBoxItem Content="Twenty Minutes" />
  235. <ComboBoxItem Content="Thirty Minutes" />
  236. <ComboBoxItem Content="Sixty Minutes" />
  237. </ComboBox>
  238. <Label
  239. Grid.Row="7"
  240. Grid.Column="0"
  241. VerticalContentAlignment="Center"
  242. Margin="0,5,0,0"
  243. Content="Zoom"/>
  244. <DockPanel
  245. Grid.Row="7"
  246. Grid.Column="1"
  247. Margin="5,5,0,0">
  248. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  249. BorderBrush="Gray" Click="ZoomSelector_Down_Click">
  250. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  251. </Button>
  252. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  253. BorderBrush="Gray" Click="ZoomSelector_Up_Click">
  254. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  255. </Button>
  256. <TextBox x:Name="ZoomSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  257. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  258. </DockPanel>
  259. </Grid>
  260. </dynamicGrid:DynamicSplitPanel.Detail>
  261. </dynamicGrid:DynamicSplitPanel>
  262. </UserControl>