AssignmentList.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ContentPage
  3. xmlns="http://xamarin.com/schemas/2014/forms"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  5. xmlns:material="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
  6. x:Class="comal.timesheets.AssignmentList"
  7. xmlns:local="clr-namespace:comal.timesheets"
  8. xmlns:schedule="clr-namespace:Syncfusion.SfSchedule.XForms;assembly=Syncfusion.SfSchedule.XForms"
  9. >
  10. <ContentPage.Resources>
  11. <ResourceDictionary>
  12. <DataTemplate x:Key="DayViewAppointments">
  13. <Grid>
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="*"/>
  16. <ColumnDefinition Width="Auto"/>
  17. </Grid.ColumnDefinitions>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="Auto"/>
  20. <RowDefinition Height="*"/>
  21. </Grid.RowDefinitions>
  22. <Frame Grid.ColumnSpan="2" Grid.RowSpan="2" BorderColor="Gray" Margin="1" CornerRadius="5" HasShadow="False" Background="{Binding Color}" />
  23. <Label Grid.Row="0" Grid.Column="0" Margin="5,2,0,0" FontAttributes="Bold" FontSize="Small" Text="{Binding Subject}" />
  24. <Image Grid.Row="0" Grid.Column="1" Margin="0,2,5,0" Source="gear" HeightRequest="32" WidthRequest="32" IsVisible="{Binding Completed}"/>
  25. <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,2,5" FontSize="Small" Text="{Binding Notes}" />
  26. </Grid>
  27. </DataTemplate>
  28. <schedule:ScheduleAppointmentMapping x:Key="AppointmentMapping"
  29. IdMapping="Id"
  30. SubjectMapping="Subject"
  31. ColorMapping="Color"
  32. StartTimeMapping="StartTime"
  33. EndTimeMapping="EndTime"
  34. NotesMapping="Notes"
  35. TextColorMapping="TextColor"
  36. ResourceIdsMapping="ResourceIds"
  37. >
  38. </schedule:ScheduleAppointmentMapping>
  39. </ResourceDictionary>
  40. </ContentPage.Resources>
  41. <ContentPage.BindingContext>
  42. <local:AssignmentListDataModel x:Name="DataModel"/>
  43. </ContentPage.BindingContext>
  44. <NavigationPage.TitleView>
  45. <Grid Margin="0" Padding="0">
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="*"/>
  48. <ColumnDefinition Width="Auto"/>
  49. </Grid.ColumnDefinitions>
  50. <Label
  51. Grid.Column="0"
  52. x:Name="Title"
  53. Text="Assignments"
  54. VerticalOptions="Center"
  55. HorizontalOptions="Center"
  56. HorizontalTextAlignment="Center"
  57. TextColor="White"
  58. FontSize="Medium"
  59. FontAttributes="Bold"
  60. BackgroundColor="Transparent"/>
  61. <StackLayout
  62. Grid.Column="1"
  63. Orientation="Horizontal"
  64. x:Name="Buttons">
  65. <Image
  66. x:Name="SelectDate"
  67. Aspect="AspectFit"
  68. WidthRequest="30"
  69. HorizontalOptions="End"
  70. Margin="5,5,0,5">
  71. <Image.Source>
  72. <OnPlatform x:TypeArguments="ImageSource">
  73. <OnPlatform.Platforms>
  74. <On Platform="iOS" Value="calendar"/>
  75. <On Platform="Android" Value="calendar"/>
  76. </OnPlatform.Platforms>
  77. </OnPlatform>
  78. </Image.Source>
  79. <Image.GestureRecognizers>
  80. <TapGestureRecognizer Tapped="SelectedDate_Tapped"/>
  81. </Image.GestureRecognizers>
  82. </Image>
  83. <DatePicker x:Name="DatePicker" IsVisible="False" DateSelected="DatePicker_OnDateSelected" />
  84. <Image
  85. x:Name="SelectEmployees"
  86. Aspect="AspectFit"
  87. WidthRequest="30"
  88. HorizontalOptions="End"
  89. Margin="5">
  90. <Image.Source>
  91. <OnPlatform x:TypeArguments="ImageSource">
  92. <OnPlatform.Platforms>
  93. <On Platform="iOS" Value="user"/>
  94. <On Platform="Android" Value="user"/>
  95. </OnPlatform.Platforms>
  96. </OnPlatform>
  97. </Image.Source>
  98. <Image.GestureRecognizers>
  99. <TapGestureRecognizer Tapped="SelectEmployees_Tapped"/>
  100. </Image.GestureRecognizers>
  101. </Image>
  102. </StackLayout>
  103. </Grid>
  104. </NavigationPage.TitleView>
  105. <ContentPage.Content>
  106. <Grid>
  107. <Grid.ColumnDefinitions>
  108. <ColumnDefinition Width="*" x:Name="DayViewColumn"/>
  109. <ColumnDefinition Width="0" x:Name="TimeLineViewColumn"/>
  110. <ColumnDefinition Width="150" x:Name="JobColumn" />
  111. </Grid.ColumnDefinitions>
  112. <Grid.RowDefinitions>
  113. <RowDefinition Height="40"/>
  114. <RowDefinition Height="*"/>
  115. </Grid.RowDefinitions>
  116. <Frame
  117. Grid.Row="0"
  118. Grid.Column="0"
  119. Grid.ColumnSpan="2"
  120. CornerRadius="2"
  121. BorderColor="Silver"
  122. BackgroundColor="WhiteSmoke"
  123. HasShadow="False"
  124. Margin="0"
  125. Padding="2"
  126. >
  127. <Label
  128. x:Name="ScheduleType"
  129. HorizontalOptions="Fill"
  130. VerticalOptions="Fill"
  131. VerticalTextAlignment="Center"
  132. HorizontalTextAlignment="Center"
  133. FontSize="Micro"/>
  134. </Frame>
  135. <schedule:SfSchedule
  136. x:Name="DayView"
  137. Grid.Row="1"
  138. Grid.Column="0"
  139. ScheduleView="DayView"
  140. HeaderHeight="0"
  141. ViewHeaderHeight="0"
  142. TimeInterval="30"
  143. Background="White"
  144. EnableNavigation="False"
  145. VerticalOptions="Fill"
  146. ShowResourceView="False"
  147. ResourceViewMode="Absolute"
  148. TimeIntervalHeight="150"
  149. AllowAppointmentDrag="True"
  150. AppointmentMapping="{StaticResource AppointmentMapping}"
  151. AppointmentTemplate="{StaticResource DayViewAppointments}"
  152. CellTapped="Schedule_OnCellTapped"
  153. CellLongPressed="Schedule_OnCellLongPressed"
  154. >
  155. <schedule:SfSchedule.DayViewSettings>
  156. <schedule:DayViewSettings TimeRulerSize="50"/>
  157. </schedule:SfSchedule.DayViewSettings>
  158. </schedule:SfSchedule>
  159. <schedule:SfSchedule
  160. x:Name="TimeLineView"
  161. Grid.Row="1"
  162. Grid.Column="1"
  163. ScheduleView="TimelineView"
  164. HeaderHeight="0"
  165. ViewHeaderHeight="0"
  166. TimeInterval="60"
  167. Background="White"
  168. ShowResourceView="False"
  169. EnableNavigation="False"
  170. ResourceViewHeight="50"
  171. ResourceViewMode="Absolute"
  172. TimeIntervalHeight="150"
  173. AllowAppointmentDrag="True"
  174. AppointmentMapping="{StaticResource AppointmentMapping}"
  175. AppointmentTemplate="{StaticResource DayViewAppointments}"
  176. CellTapped="Schedule_OnCellTapped"
  177. CellLongPressed="Schedule_OnCellLongPressed"
  178. >
  179. <schedule:SfSchedule.TimelineViewSettings>
  180. <schedule:TimelineViewSettings AppointmentHeight="200"/>
  181. </schedule:SfSchedule.TimelineViewSettings>
  182. <schedule:SfSchedule.ResourceItemTemplate>
  183. <DataTemplate>
  184. <Grid >
  185. <Grid.RowDefinitions>
  186. <RowDefinition Height="*"/>
  187. </Grid.RowDefinitions>
  188. <Grid.ColumnDefinitions>
  189. <ColumnDefinition Width="*"/>
  190. </Grid.ColumnDefinitions>
  191. <Label Text="{Binding Name}" Margin="-100,-0,-100,0" FontSize="Micro" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Rotation="-90"/>
  192. </Grid>
  193. </DataTemplate>
  194. </schedule:SfSchedule.ResourceItemTemplate>
  195. </schedule:SfSchedule>
  196. <Frame
  197. Grid.Row="0"
  198. Grid.Column="2"
  199. CornerRadius="2"
  200. BorderColor="Silver"
  201. BackgroundColor="WhiteSmoke"
  202. HasShadow="False"
  203. Margin="0"
  204. Padding="2"
  205. >
  206. <Frame.GestureRecognizers>
  207. <TapGestureRecognizer Tapped="LookupsType_Tapped" />
  208. </Frame.GestureRecognizers>
  209. <Label
  210. x:Name="LookupType"
  211. HorizontalOptions="Fill"
  212. VerticalOptions="Fill"
  213. VerticalTextAlignment="Center"
  214. HorizontalTextAlignment="Center"
  215. FontSize="Micro"/>
  216. </Frame>
  217. <ListView
  218. x:Name="Lookups"
  219. Grid.Row="1"
  220. Grid.Column="2"
  221. HasUnevenRows="True"
  222. ItemTapped="Lookups_OnItemTapped">
  223. <ListView.ItemTemplate>
  224. <DataTemplate>
  225. <ViewCell>
  226. <Frame BorderColor="Silver" CornerRadius="2" HasShadow="False" VerticalOptions="FillAndExpand" BackgroundColor="{Binding Colour}" Margin="0,0,2,2">
  227. <Grid VerticalOptions="FillAndExpand">
  228. <Grid.RowDefinitions>
  229. <RowDefinition Height="Auto"/>
  230. <RowDefinition Height="Auto"/>
  231. </Grid.RowDefinitions>
  232. <Label Text="{Binding Number}" Grid.Row="0" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" FontSize="Micro"/>
  233. <Label Text="{Binding Name}" Grid.Row="1" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" FontSize="Micro"/>
  234. </Grid>
  235. </Frame>
  236. </ViewCell>
  237. </DataTemplate>
  238. </ListView.ItemTemplate>
  239. </ListView>
  240. </Grid>
  241. </ContentPage.Content>
  242. </ContentPage>