AssignmentList.xaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. </Grid.ColumnDefinitions>
  111. <Grid.RowDefinitions>
  112. <RowDefinition Height="*"/>
  113. </Grid.RowDefinitions>
  114. <schedule:SfSchedule x:Name="DayView"
  115. Grid.Column="0"
  116. ScheduleView="DayView"
  117. HeaderHeight="0"
  118. ViewHeaderHeight="0"
  119. TimeInterval="60"
  120. Background="White"
  121. EnableNavigation="False"
  122. VerticalOptions="Fill"
  123. ShowResourceView="False"
  124. ResourceViewMode="Absolute"
  125. TimeIntervalHeight="150"
  126. AppointmentMapping="{StaticResource AppointmentMapping}"
  127. AppointmentTemplate="{StaticResource DayViewAppointments}"
  128. CellTapped="Schedule_OnCellTapped"
  129. CellLongPressed="Schedule_OnCellLongPressed"
  130. >
  131. <schedule:SfSchedule.DayViewSettings>
  132. <schedule:DayViewSettings TimeRulerSize="50"/>
  133. </schedule:SfSchedule.DayViewSettings>
  134. </schedule:SfSchedule>
  135. <schedule:SfSchedule x:Name="TimeLineView"
  136. Grid.Column="1"
  137. ScheduleView="TimelineView"
  138. HeaderHeight="0"
  139. ViewHeaderHeight="0"
  140. TimeInterval="60"
  141. Background="White"
  142. ShowResourceView="False"
  143. EnableNavigation="False"
  144. ResourceViewHeight="50"
  145. ResourceViewMode="Absolute"
  146. TimeIntervalHeight="150"
  147. AppointmentMapping="{StaticResource AppointmentMapping}"
  148. AppointmentTemplate="{StaticResource DayViewAppointments}"
  149. CellTapped="Schedule_OnCellTapped"
  150. CellLongPressed="Schedule_OnCellLongPressed"
  151. >
  152. <schedule:SfSchedule.TimelineViewSettings>
  153. <schedule:TimelineViewSettings AppointmentHeight="200"/>
  154. </schedule:SfSchedule.TimelineViewSettings>
  155. <schedule:SfSchedule.ResourceItemTemplate>
  156. <DataTemplate>
  157. <Grid >
  158. <Grid.RowDefinitions>
  159. <RowDefinition Height="*"/>
  160. </Grid.RowDefinitions>
  161. <Grid.ColumnDefinitions>
  162. <ColumnDefinition Width="*"/>
  163. </Grid.ColumnDefinitions>
  164. <Label Text="{Binding Name}" Margin="-100,-0,-100,0" FontSize="Micro" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Rotation="-90"/>
  165. </Grid>
  166. </DataTemplate>
  167. </schedule:SfSchedule.ResourceItemTemplate>
  168. </schedule:SfSchedule>
  169. </Grid>
  170. </ContentPage.Content>
  171. </ContentPage>