AssignmentList.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <local:BasePage
  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. <local:BasePage.Resources>
  11. <ResourceDictionary>
  12. <DataTemplate x:Key="DayViewAppointments">
  13. <Frame Grid.ColumnSpan="2" Grid.RowSpan="2" BorderColor="Gray" Margin="1" Padding="5,2,2,2" CornerRadius="5" HasShadow="False" Background="{Binding Color}">
  14. <Grid ColumnSpacing="0" RowSpacing="0">
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="*"/>
  17. <ColumnDefinition Width="Auto"/>
  18. </Grid.ColumnDefinitions>
  19. <Grid.RowDefinitions>
  20. <RowDefinition Height="Auto"/>
  21. <RowDefinition Height="*"/>
  22. </Grid.RowDefinitions>
  23. <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0" FontAttributes="Bold" FontSize="Micro" Text="{Binding Subject}"/>
  24. <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0" FontSize="Micro" Text="{Binding Notes}" />
  25. <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" Margin="0" Source="tick" HeightRequest="20" WidthRequest="20" IsVisible="{Binding Completed}" HorizontalOptions="End" VerticalOptions="Start"/>
  26. </Grid>
  27. </Frame>
  28. </DataTemplate>
  29. <schedule:ScheduleAppointmentMapping x:Key="AppointmentMapping"
  30. IdMapping="Id"
  31. SubjectMapping="Subject"
  32. ColorMapping="Color"
  33. StartTimeMapping="StartTime"
  34. EndTimeMapping="EndTime"
  35. NotesMapping="Notes"
  36. TextColorMapping="TextColor"
  37. ResourceIdsMapping="ResourceIds"
  38. >
  39. </schedule:ScheduleAppointmentMapping>
  40. </ResourceDictionary>
  41. </local:BasePage.Resources>
  42. <local:BasePage.ActionButtons>
  43. <ImageButton x:Name="ShowHideSources" Clicked="ShowHideSources_OnClicked" Source="downarrowwhite"/>
  44. </local:BasePage.ActionButtons>
  45. <local:BasePage.PageContent>
  46. <Grid ColumnSpacing="2" RowSpacing="2" Margin="2">
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="*" x:Name="ScheduleColumn"/>
  49. <ColumnDefinition Width="0" x:Name="JobColumn" />
  50. </Grid.ColumnDefinitions>
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="40"/>
  53. <RowDefinition Height="*"/>
  54. </Grid.RowDefinitions>
  55. <DatePicker x:Name="DatePicker" Grid.Row="0" IsVisible="False" DateSelected="DatePicker_OnDateSelected" />
  56. <Grid Grid.Row="0" Grid.Column="0" ColumnSpacing="0">
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition Width="Auto"/>
  59. <ColumnDefinition Width="*"/>
  60. </Grid.ColumnDefinitions>
  61. <local:ActionButton x:Name="SelectDate" Image="calendar" Grid.Row="0" Grid.Column="0" Clicked="SelectDate_OnClicked" Margin="0" />
  62. <local:ActionButton x:Name="ScheduleType" Grid.Row="0" Grid.Column="1" Clicked="SelectEmployees_OnClicked" Margin="0" />
  63. </Grid>
  64. <Frame x:Name="DayFrame" Grid.Row="1" Grid.Column="0" BorderColor="Silver" IsVisible="True" CornerRadius="5" HasShadow="False" Padding="0">
  65. <schedule:SfSchedule
  66. x:Name="DayView"
  67. ScheduleView="DayView"
  68. HeaderHeight="0"
  69. ViewHeaderHeight="0"
  70. TimeInterval="30"
  71. Background="White"
  72. EnableNavigation="False"
  73. VerticalOptions="Fill"
  74. ShowResourceView="False"
  75. ResourceViewMode="Absolute"
  76. TimeIntervalHeight="150"
  77. AllowAppointmentDrag="True"
  78. AppointmentMapping="{StaticResource AppointmentMapping}"
  79. AppointmentTemplate="{StaticResource DayViewAppointments}"
  80. CellTapped="Schedule_OnCellTapped"
  81. CellLongPressed="Schedule_OnCellLongPressed"
  82. Margin="0"
  83. >
  84. <schedule:SfSchedule.DayViewSettings>
  85. <schedule:DayViewSettings TimeRulerSize="50"/>
  86. </schedule:SfSchedule.DayViewSettings>
  87. </schedule:SfSchedule>
  88. </Frame>
  89. <Frame x:Name="TimelineFrame" Grid.Row="1" Grid.Column="0" BorderColor="Silver" IsVisible="False" CornerRadius="5" HasShadow="False" Padding="0">
  90. <schedule:SfSchedule
  91. x:Name="TimeLineView"
  92. ScheduleView="TimelineView"
  93. HeaderHeight="0"
  94. ViewHeaderHeight="0"
  95. TimeInterval="60"
  96. Background="White"
  97. ShowResourceView="False"
  98. EnableNavigation="False"
  99. ResourceViewHeight="50"
  100. ResourceViewMode="Absolute"
  101. TimeIntervalHeight="150"
  102. AllowAppointmentDrag="True"
  103. AppointmentMapping="{StaticResource AppointmentMapping}"
  104. AppointmentTemplate="{StaticResource DayViewAppointments}"
  105. CellTapped="Schedule_OnCellTapped"
  106. CellLongPressed="Schedule_OnCellLongPressed"
  107. Margin="0"
  108. >
  109. <schedule:SfSchedule.TimelineViewSettings>
  110. <schedule:TimelineViewSettings AppointmentHeight="200"/>
  111. </schedule:SfSchedule.TimelineViewSettings>
  112. <schedule:SfSchedule.ResourceItemTemplate>
  113. <DataTemplate>
  114. <Grid >
  115. <Grid.RowDefinitions>
  116. <RowDefinition Height="*"/>
  117. </Grid.RowDefinitions>
  118. <Grid.ColumnDefinitions>
  119. <ColumnDefinition Width="*"/>
  120. </Grid.ColumnDefinitions>
  121. <Label Text="{Binding Name}" Margin="-100,-0,-100,0" FontSize="Micro" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Rotation="-90"/>
  122. </Grid>
  123. </DataTemplate>
  124. </schedule:SfSchedule.ResourceItemTemplate>
  125. </schedule:SfSchedule>
  126. </Frame>
  127. <local:ActionButton
  128. x:Name="LookupType"
  129. Grid.Row="0"
  130. Grid.Column="1"
  131. Clicked="LookupsType_Tapped"
  132. Margin="0" />
  133. <Frame x:Name="LookupsFrame" Grid.Row="1" Grid.Column="1" BorderColor="Silver" CornerRadius="5" HasShadow="False" Padding="0">
  134. <ListView
  135. x:Name="Lookups"
  136. HasUnevenRows="True"
  137. ItemTapped="Lookups_OnItemTapped">
  138. <ListView.ItemTemplate>
  139. <DataTemplate>
  140. <ViewCell>
  141. <Grid VerticalOptions="FillAndExpand" BackgroundColor="{Binding Colour}" Margin="2,5,2,0">
  142. <Grid.RowDefinitions>
  143. <RowDefinition Height="Auto"/>
  144. <RowDefinition Height="Auto"/>
  145. <RowDefinition Height="Auto"/>
  146. </Grid.RowDefinitions>
  147. <Label Text="{Binding Code}" Grid.Row="0" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" FontSize="Micro"/>
  148. <Label Text="{Binding Description}" Grid.Row="1" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Center" FontSize="Micro"/>
  149. <BoxView Grid.Row="2" HeightRequest="1" Color="Silver" />
  150. </Grid>
  151. </ViewCell>
  152. </DataTemplate>
  153. </ListView.ItemTemplate>
  154. </ListView>
  155. </Frame>
  156. </Grid>
  157. </local:BasePage.PageContent>
  158. </local:BasePage>