Calendar.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. QueryAppointments="Bookings_OnQueryAppointments"
  39. ViewType="Day"
  40. BorderThickness="1"
  41. BorderBrush="Silver"
  42. Background="Silver"
  43. ResourceGroupType="Date"
  44. FirstDayOfWeek="Monday"
  45. >
  46. <!-- <syncfusion:SfScheduler.HeaderTemplate> -->
  47. <!-- <DataTemplate> -->
  48. <!-- <Border BorderBrush="Transparent" Background="Transparent" Height="0" Width="200"/> -->
  49. <!-- </DataTemplate> -->
  50. <!-- </syncfusion:SfScheduler.HeaderTemplate> -->
  51. <syncfusion:SfScheduler.CellContextMenu>
  52. <ContextMenu />
  53. </syncfusion:SfScheduler.CellContextMenu>
  54. <syncfusion:SfScheduler.AppointmentContextMenu>
  55. <ContextMenu />
  56. </syncfusion:SfScheduler.AppointmentContextMenu>
  57. <syncfusion:SfScheduler.DaysViewSettings>
  58. <syncfusion:DaysViewSettings ViewHeaderDateFormat="dd MMM yy" ViewHeaderDayFormat="dddd"
  59. ViewHeaderHeight="45" TimeRulerFormat="hh:mm tt" TimeInterval="0:30"
  60. MinimumAllDayAppointmentsCount="0">
  61. <syncfusion:DaysViewSettings.ViewHeaderTemplate>
  62. <DataTemplate>
  63. <StackPanel Background="WhiteSmoke" Margin="-10,0,0,0" VerticalAlignment="Stretch"
  64. HorizontalAlignment="Stretch" Orientation="Vertical">
  65. <Label HorizontalContentAlignment="Center" Content="{Binding DayText}" FontSize="12"
  66. Foreground="Black" FontFamily="Arial" FontWeight="Bold"
  67. VerticalContentAlignment="Bottom" Margin="0,0,0,-5" />
  68. <Label HorizontalContentAlignment="Center" Content="{Binding DateText}" FontSize="10"
  69. VerticalContentAlignment="Top" />
  70. </StackPanel>
  71. </DataTemplate>
  72. </syncfusion:DaysViewSettings.ViewHeaderTemplate>
  73. <syncfusion:DaysViewSettings.AppointmentTemplate>
  74. <DataTemplate>
  75. <Border BorderThickness="0" Background="{Binding AppointmentBackground}" Padding="2" CornerRadius="2">
  76. <!-- <Border.ToolTip> -->
  77. <!-- <local:CalendarBlock DataContext="{Binding}" /> -->
  78. <!-- </Border.ToolTip> -->
  79. <local:CalendarBlock DataContext="{Binding}" />
  80. </Border>
  81. </DataTemplate>
  82. </syncfusion:DaysViewSettings.AppointmentTemplate>
  83. </syncfusion:DaysViewSettings>
  84. </syncfusion:SfScheduler.DaysViewSettings>
  85. </local:SfScheduler2>
  86. </dynamicGrid:DynamicSplitPanel.Master>
  87. <dynamicGrid:DynamicSplitPanel.Detail>
  88. <Grid>
  89. <Grid.ColumnDefinitions>
  90. <ColumnDefinition Width="Auto" />
  91. <ColumnDefinition Width="*" />
  92. </Grid.ColumnDefinitions>
  93. <Grid.RowDefinitions>
  94. <RowDefinition Height="Auto" />
  95. <RowDefinition Height="*" />
  96. <RowDefinition Height="Auto" />
  97. <RowDefinition Height="Auto" />
  98. <RowDefinition Height="Auto" />
  99. <RowDefinition Height="Auto" />
  100. <RowDefinition Height="Auto" />
  101. <RowDefinition Height="Auto" />
  102. <RowDefinition Height="Auto" />
  103. </Grid.RowDefinitions>
  104. <DockPanel
  105. Grid.Row="0"
  106. Grid.Column="0"
  107. Grid.ColumnSpan="2">
  108. <Button
  109. x:Name="_settingsButton"
  110. DockPanel.Dock="Left"
  111. Click="_settingsButton_OnClick"
  112. Background="WhiteSmoke"
  113. BorderBrush="Gray"
  114. BorderThickness="0.75"
  115. Height="25"
  116. Width="25"
  117. Padding="2">
  118. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  119. </Button>
  120. <ComboBox
  121. x:Name="CalendarViewSelector"
  122. DockPanel.Dock="Left"
  123. SelectionChanged="CalendarViewSelector_SelectionChanged"
  124. VerticalContentAlignment="Center"
  125. SelectedIndex="-1"
  126. Margin="5,0,0,0">
  127. <ComboBoxItem Content="Day" />
  128. <ComboBoxItem Content="Work Week" />
  129. <ComboBoxItem Content="Week" />
  130. </ComboBox>
  131. </DockPanel>
  132. <local:EmployeeSelector
  133. x:Name="EmployeeSelector"
  134. Grid.Row="1"
  135. Grid.Column="0"
  136. Grid.ColumnSpan="2"
  137. Margin="-5,5,0,0"
  138. SettingsChanged="EmployeeSelector_OnSettingsChanged"
  139. SelectionChanged="EmployeeSelector_OnSelectionChanged"/>
  140. <Label
  141. Grid.Row="2"
  142. Grid.Column="0"
  143. VerticalContentAlignment="Center"
  144. Margin="0,5,0,0"
  145. Content="Start" />
  146. <DockPanel
  147. Grid.Row="2"
  148. Grid.Column="1"
  149. Margin="5,5,0,0">
  150. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  151. BorderBrush="Gray" Click="StartTimeSelector_Down_Click">
  152. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  153. </Button>
  154. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  155. BorderBrush="Gray" Click="StartTimeSelector_Up_Click">
  156. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  157. </Button>
  158. <TextBox x:Name="StartTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  159. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  160. </DockPanel>
  161. <Label
  162. Grid.Row="3"
  163. Grid.Column="0"
  164. VerticalContentAlignment="Center"
  165. Margin="0,5,0,0"
  166. Content="Finish"/>
  167. <DockPanel
  168. Grid.Row="3"
  169. Grid.Column="1"
  170. Margin="5,5,0,0">
  171. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  172. BorderBrush="Gray" Click="FinishTimeSelector_Down_Click">
  173. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  174. </Button>
  175. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  176. BorderBrush="Gray" Click="FinishTimeSelector_Up_Click">
  177. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  178. </Button>
  179. <TextBox x:Name="FinishTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  180. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  181. </DockPanel>
  182. <Label
  183. Grid.Row="4"
  184. Grid.Column="0"
  185. VerticalContentAlignment="Center"
  186. Margin="0,5,0,0"
  187. Content="Assignments" />
  188. <ComboBox
  189. x:Name="AssignmentTypeSelector"
  190. Grid.Row="4"
  191. Grid.Column="1"
  192. SelectedIndex="0"
  193. Margin="5,5,0,0"
  194. SelectionChanged="AssignmentTypeSelector_OnSelectionChanged"
  195. VerticalContentAlignment="Center">
  196. <ComboBoxItem Content="Automatic" />
  197. <ComboBoxItem Content="Booked Time" />
  198. <ComboBoxItem Content="Actual Time" />
  199. </ComboBox>
  200. <Label
  201. Grid.Row="5"
  202. Grid.Column="0"
  203. VerticalContentAlignment="Center"
  204. Margin="0,5,0,0"
  205. Content="Background" />
  206. <ComboBox
  207. x:Name="BackgroundTypeSelector"
  208. Grid.Row="5"
  209. Grid.Column="1"
  210. SelectedIndex="0"
  211. Margin="5,5,0,0"
  212. SelectionChanged="BackgroundTypeSelector_OnSelectionChanged"
  213. VerticalContentAlignment="Center">
  214. <ComboBoxItem Content="Automatic" />
  215. <ComboBoxItem Content="Rosters" />
  216. <ComboBoxItem Content="Timesheets" />
  217. </ComboBox>
  218. <Label
  219. Grid.Row="6"
  220. Grid.Column="0"
  221. VerticalContentAlignment="Center"
  222. Margin="0,5,0,0"
  223. Content="Interval"/>
  224. <ComboBox
  225. x:Name="IntervalSelector"
  226. Grid.Row="6"
  227. Grid.Column="1"
  228. SelectedIndex="0"
  229. Margin="5,5,0,0"
  230. SelectionChanged="IntervalSelector_OnSelectionChanged"
  231. VerticalContentAlignment="Center">
  232. <ComboBoxItem Content="Five Minutes" />
  233. <ComboBoxItem Content="Six Minutes" />
  234. <ComboBoxItem Content="Ten Minutes" />
  235. <ComboBoxItem Content="Fifteen Minutes" />
  236. <ComboBoxItem Content="Twenty Minutes" />
  237. <ComboBoxItem Content="Thirty Minutes" />
  238. <ComboBoxItem Content="Sixty Minutes" />
  239. </ComboBox>
  240. <Label
  241. Grid.Row="7"
  242. Grid.Column="0"
  243. VerticalContentAlignment="Center"
  244. Margin="0,5,0,0"
  245. Content="Zoom"/>
  246. <DockPanel
  247. Grid.Row="7"
  248. Grid.Column="1"
  249. Margin="5,5,0,0">
  250. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  251. BorderBrush="Gray" Click="ZoomSelector_Down_Click">
  252. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  253. </Button>
  254. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  255. BorderBrush="Gray" Click="ZoomSelector_Up_Click">
  256. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  257. </Button>
  258. <TextBox x:Name="ZoomSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  259. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  260. </DockPanel>
  261. <DockPanel Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2"
  262. Margin="0,5,0,0">
  263. <CheckBox DockPanel.Dock="Right"
  264. x:Name="AlwaysTodayBox"
  265. Checked="AlwaysTodayBox_Checked"
  266. Unchecked="AlwaysTodayBox_Checked"
  267. VerticalAlignment="Center"/>
  268. <Label Content="Always Start On Today" DockPanel.Dock="Left"
  269. VerticalContentAlignment="Center"/>
  270. </DockPanel>
  271. </Grid>
  272. </dynamicGrid:DynamicSplitPanel.Detail>
  273. </dynamicGrid:DynamicSplitPanel>
  274. </UserControl>