Calendar.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. mc:Ignorable="d"
  9. d:DesignHeight="600" d:DesignWidth="800" SizeChanged="Calendar_OnSizeChanged">
  10. <UserControl.Resources>
  11. <Style TargetType="syncfusion:TimeRulerCell">
  12. <Setter Property='VerticalContentAlignment' Value="Center" />
  13. </Style>
  14. <Style TargetType="syncfusion:AppointmentControl">
  15. <Setter Property="BorderBrush" Value="DimGray" />
  16. <Setter Property="SelectionBorderBrush" Value="Red"/>
  17. <Setter Property="BorderThickness" Value="0.75"/>
  18. <Setter Property="Margin" Value="0,0,-8,0"/>
  19. </Style>
  20. </UserControl.Resources>
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="*" />
  24. </Grid.RowDefinitions>
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="*" />
  27. <ColumnDefinition Width="240" x:Name="VisibleSettingsColumn" />
  28. <ColumnDefinition Width="0" x:Name="HiddenSettingsColumn"/>
  29. </Grid.ColumnDefinitions>
  30. <syncfusion:SfScheduler
  31. Grid.Column="0"
  32. Grid.Row="0"
  33. Name="Bookings"
  34. HeaderDateFormat="dd MMM yyyy"
  35. SizeChanged="Schedule_SizeChanged"
  36. AppointmentEditorOpening="Schedule_AppointmentEditorOpening"
  37. SchedulerContextMenuOpening="Bookings_OnSchedulerContextMenuOpening"
  38. AppointmentTapped="Bookings_OnAppointmentTapped"
  39. ViewType="Day"
  40. HeaderHeight="0"
  41. BorderThickness="1"
  42. BorderBrush="Silver"
  43. Background="Silver"
  44. ResourceGroupType="Date"
  45. FirstDayOfWeek="Monday"
  46. >
  47. <!-- <syncfusion:SfScheduler.AppointmentMapping> -->
  48. <!-- <syncfusion:AppointmentMapping -->
  49. <!-- Id="Id" -->
  50. <!-- Subject = "Subject" -->
  51. <!-- Notes = "Notes" -->
  52. <!-- StartTime="StartTime" -->
  53. <!-- EndTime="EndTime" -->
  54. <!-- AppointmentBackground="Background" -->
  55. <!-- Foreground="Foreground" -->
  56. <!-- ResourceIdCollection="ResourceIdCollection" -->
  57. <!-- /> -->
  58. <!-- </syncfusion:SfScheduler.AppointmentMapping> -->
  59. <syncfusion:SfScheduler.CellContextMenu>
  60. <ContextMenu />
  61. </syncfusion:SfScheduler.CellContextMenu>
  62. <syncfusion:SfScheduler.AppointmentContextMenu>
  63. <ContextMenu />
  64. </syncfusion:SfScheduler.AppointmentContextMenu>
  65. <syncfusion:SfScheduler.DaysViewSettings>
  66. <syncfusion:DaysViewSettings ViewHeaderDateFormat="dd MMM yy" ViewHeaderDayFormat="dddd"
  67. ViewHeaderHeight="45" TimeRulerFormat="hh:mm tt" TimeInterval="0:30"
  68. MinimumAllDayAppointmentsCount="0">
  69. <syncfusion:DaysViewSettings.ViewHeaderTemplate>
  70. <DataTemplate>
  71. <StackPanel Background="WhiteSmoke" Margin="-10,0,0,0" VerticalAlignment="Stretch"
  72. HorizontalAlignment="Stretch" Orientation="Vertical">
  73. <Label HorizontalContentAlignment="Center" Content="{Binding DayText}" FontSize="12"
  74. Foreground="Black" FontFamily="Arial" FontWeight="Bold"
  75. VerticalContentAlignment="Bottom" Margin="0,0,0,-5" />
  76. <Label HorizontalContentAlignment="Center" Content="{Binding DateText}" FontSize="10"
  77. VerticalContentAlignment="Top" />
  78. </StackPanel>
  79. </DataTemplate>
  80. </syncfusion:DaysViewSettings.ViewHeaderTemplate>
  81. <syncfusion:DaysViewSettings.AppointmentTemplate>
  82. <DataTemplate>
  83. <Border BorderThickness="0" Background="{Binding AppointmentBackground}" Padding="2" CornerRadius="2">
  84. <Border.ToolTip>
  85. <local:CalendarBlock DataContext="{Binding}" />
  86. </Border.ToolTip>
  87. <local:CalendarBlock DataContext="{Binding}" />
  88. </Border>
  89. </DataTemplate>
  90. </syncfusion:DaysViewSettings.AppointmentTemplate>
  91. </syncfusion:DaysViewSettings>
  92. </syncfusion:SfScheduler.DaysViewSettings>
  93. </syncfusion:SfScheduler>
  94. <Grid Margin="0" Grid.Row="0" Grid.Column="1">
  95. <Grid.ColumnDefinitions>
  96. <ColumnDefinition Width="Auto" />
  97. <ColumnDefinition Width="*"/>
  98. </Grid.ColumnDefinitions>
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="Auto" />
  101. <RowDefinition Height="Auto" />
  102. <RowDefinition Height="Auto" />
  103. <RowDefinition Height="*" />
  104. <RowDefinition Height="Auto" />
  105. <RowDefinition Height="Auto" />
  106. <RowDefinition Height="Auto" />
  107. <RowDefinition Height="Auto" />
  108. <RowDefinition Height="Auto" />
  109. <RowDefinition Height="Auto" />
  110. </Grid.RowDefinitions>
  111. <DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,0,0" >
  112. <Button x:Name="HideSideBar" DockPanel.Dock="Left" Content=" &#x276f; " Width="30" Margin="0,0,5,0" BorderBrush="Gray" Background="WhiteSmoke" BorderThickness="0.75" Click="HideSideBar_OnClick"/>
  113. <!-- <Label Grid.Row="0" Grid.Column="0" Content="View" VerticalContentAlignment="Center" Margin="5,0,0,0" /> -->
  114. <ComboBox x:Name="CalendarViewSelector" DockPanel.Dock="Left" SelectionChanged="CalendarViewSelector_SelectionChanged"
  115. VerticalContentAlignment="Center" SelectedIndex="-1" >
  116. <ComboBoxItem Content="Day" />
  117. <ComboBoxItem Content="Work Week" />
  118. <ComboBoxItem Content="Week" />
  119. </ComboBox>
  120. </DockPanel>
  121. <Border BorderBrush="Gray" BorderThickness="0.75" Padding="0,0,0,0" Grid.Row="1" Grid.Column="0"
  122. Grid.ColumnSpan="2" Margin="5,5,0,5" Background="White">
  123. <syncfusion:CalendarEdit x:Name="DateSelector" ShowAbbreviatedMonthNames="True" AllowMultiplySelection="False"
  124. DateChanged="DateSelector_DateChanged" BorderBrush="Transparent" />
  125. </Border>
  126. <local:EmployeeSelector
  127. x:Name="EmployeeSelector"
  128. Grid.Row="2"
  129. Grid.RowSpan="2"
  130. Grid.Column="0"
  131. Grid.ColumnSpan="2"
  132. SettingsChanged="EmployeeSelector_OnSettingsChanged"
  133. SelectionChanged="EmployeeSelector_OnSelectionChanged"/>
  134. <Label Content="Start" Grid.Row="4" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  135. <DockPanel Grid.Row="4" Grid.Column="1" Margin="5,5,0,0">
  136. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  137. BorderBrush="Gray" Click="StartTimeSelector_Down_Click">
  138. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  139. </Button>
  140. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  141. BorderBrush="Gray" Click="StartTimeSelector_Up_Click">
  142. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  143. </Button>
  144. <TextBox x:Name="StartTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  145. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  146. </DockPanel>
  147. <Label Content="Finish" Grid.Row="5" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  148. <DockPanel Grid.Row="5" Grid.Column="1" Margin="5,5,0,0">
  149. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  150. BorderBrush="Gray" Click="FinishTimeSelector_Down_Click">
  151. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  152. </Button>
  153. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  154. BorderBrush="Gray" Click="FinishTimeSelector_Up_Click">
  155. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  156. </Button>
  157. <TextBox x:Name="FinishTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  158. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  159. </DockPanel>
  160. <Label Content="Assignments" Grid.Row="6" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  161. <ComboBox
  162. x:Name="AssignmentTypeSelector"
  163. Grid.Row="6"
  164. Grid.Column="1"
  165. SelectedIndex="0"
  166. Margin="5,5,0,0"
  167. SelectionChanged="AssignmentTypeSelector_OnSelectionChanged"
  168. VerticalContentAlignment="Center"
  169. >
  170. <ComboBoxItem Content="Automatic" />
  171. <ComboBoxItem Content="Booked Time" />
  172. <ComboBoxItem Content="Actual Time" />
  173. </ComboBox>
  174. <Label Content="Background" Grid.Row="7" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  175. <ComboBox
  176. x:Name="BackgroundTypeSelector"
  177. Grid.Row="7"
  178. Grid.Column="1"
  179. SelectedIndex="0"
  180. Margin="5,5,0,0"
  181. SelectionChanged="BackgroundTypeSelector_OnSelectionChanged"
  182. VerticalContentAlignment="Center"
  183. >
  184. <ComboBoxItem Content="Automatic" />
  185. <ComboBoxItem Content="Rosters" />
  186. <ComboBoxItem Content="Timesheets" />
  187. </ComboBox>
  188. <Label Content="Interval" Grid.Row="8" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  189. <ComboBox
  190. x:Name="IntervalSelector"
  191. Grid.Row="8"
  192. Grid.Column="1"
  193. SelectedIndex="0"
  194. Margin="5,5,0,0"
  195. SelectionChanged="IntervalSelector_OnSelectionChanged"
  196. VerticalContentAlignment="Center"
  197. >
  198. <ComboBoxItem Content="Five Minutes" />
  199. <ComboBoxItem Content="Six Minutes" />
  200. <ComboBoxItem Content="Ten Minutes" />
  201. <ComboBoxItem Content="Fifteen Minutes" />
  202. <ComboBoxItem Content="Twenty Minutes" />
  203. <ComboBoxItem Content="Thirty Minutes" />
  204. <ComboBoxItem Content="Sixty Minutes" />
  205. </ComboBox>
  206. <Label Content="Zoom" Grid.Row="9" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  207. <DockPanel Grid.Row="9" Grid.Column="1" Margin="5,5,0,0">
  208. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  209. BorderBrush="Gray" Click="ZoomSelector_Down_Click">
  210. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
  211. </Button>
  212. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  213. BorderBrush="Gray" Click="ZoomSelector_Up_Click">
  214. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
  215. </Button>
  216. <TextBox x:Name="ZoomSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  217. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  218. </DockPanel>
  219. </Grid>
  220. <DockPanel Grid.Row="0" Grid.Column="2">
  221. <Button x:Name="ShowSideBar" DockPanel.Dock="Top" Content=" &#x276e; " Margin="5,0,0,0" Padding="4" BorderBrush="Gray" Background="WhiteSmoke" BorderThickness="0.75,0.75,0.75,0" Click="ShowSideBar_OnClick"/>
  222. <Border DockPanel.Dock="Top" Margin="5,0,0,0" BorderBrush="Gray" Background="WhiteSmoke" BorderThickness="0.75,0,0.75,0.75">
  223. <Label Content="Settings" HorizontalContentAlignment="Right" Margin="0,5,0,0" Background="Transparent">
  224. <Label.LayoutTransform>
  225. <RotateTransform Angle="270"/>
  226. </Label.LayoutTransform>
  227. </Label>
  228. </Border>
  229. </DockPanel>
  230. </Grid>
  231. </UserControl>