You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
6.6 KiB

1 year ago
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. x:Class="GMCabsDriverAssistantSolution.Views.AcceptedFutureBookingsPage"
  5. xmlns:vm="clr-namespace:GMCabsDriverAssistantSolution.ViewModels"
  6. xmlns:models="clr-namespace:GMCabsDriverAssistant.Models"
  7. x:DataType="vm:AcceptedFutureBookingsViewModel"
  8. Title="{Binding Title}"
  9. Shell.FlyoutBehavior="Disabled">
  10. <ContentPage.Resources>
  11. <ResourceDictionary>
  12. <Color x:Key="Accent">#96d1ff</Color>
  13. </ResourceDictionary>
  14. </ContentPage.Resources>
  15. <ContentPage.Content>
  16. <StackLayout Orientation="Vertical"
  17. BackgroundColor="#DCDCDC"
  18. x:DataType="vm:AcceptedFutureBookingsViewModel">
  19. <Frame Margin="10,40,10,10"
  20. CornerRadius="10"
  21. BackgroundColor="#E8E8E8">
  22. <CollectionView ItemsSource="{Binding FutureBookings}"
  23. EmptyView="{Binding EmptyViewMessage}">
  24. <CollectionView.ItemsLayout>
  25. <LinearItemsLayout
  26. Orientation="Vertical"
  27. ItemSpacing="10"/>
  28. </CollectionView.ItemsLayout>
  29. <CollectionView.ItemTemplate>
  30. <DataTemplate>
  31. <Frame x:DataType="models:BookingDto"
  32. CornerRadius="10"
  33. BackgroundColor="{StaticResource Primary}"
  34. Padding="8">
  35. <StackLayout Orientation="Vertical">
  36. <Grid>
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="Auto"/>
  39. <ColumnDefinition Width="1*"/>
  40. </Grid.ColumnDefinitions>
  41. <Label Grid.Row="0"
  42. Grid.Column="0"
  43. Text="{Binding StartSuburb}"
  44. TextColor="White"
  45. FontFamily="Bold"
  46. HorizontalOptions="StartAndExpand"
  47. FontSize="17"/>
  48. <Label
  49. Grid.Row="0"
  50. Grid.Column="1"
  51. VerticalTextAlignment="Center"
  52. HorizontalOptions="EndAndExpand"
  53. FontSize="17"
  54. TextColor="White">
  55. <Label.Triggers>
  56. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="True">
  57. <Setter Property="Text" Value="{Binding FormattedPickUpTimeDateOnly}"/>
  58. </DataTrigger>
  59. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="False">
  60. <Setter Property="Text" Value="{Binding FormattedDistance}" />
  61. </DataTrigger>
  62. </Label.Triggers>
  63. </Label>
  64. <Label Grid.Row="1"
  65. Grid.Column="0"
  66. Text="{Binding EndSuburb}"
  67. TextColor="White"
  68. FontFamily="Bold"
  69. HorizontalOptions="StartAndExpand"
  70. FontSize="17"/>
  71. <Label
  72. Grid.Row="1"
  73. Grid.Column="1"
  74. VerticalTextAlignment="Center"
  75. HorizontalOptions="EndAndExpand"
  76. FontSize="17"
  77. TextColor="White">
  78. <Label.Triggers>
  79. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="True">
  80. <Setter Property="Text" Value="{Binding FormattedPickUpTimeTimeOnly}" />
  81. </DataTrigger>
  82. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="False">
  83. <Setter Property="Text" Value="ASAP" />
  84. </DataTrigger>
  85. </Label.Triggers>
  86. </Label>
  87. </Grid>
  88. </StackLayout>
  89. <Frame.GestureRecognizers>
  90. <TapGestureRecognizer
  91. NumberOfTapsRequired="1"
  92. Command="{Binding Source={RelativeSource AncestorType={x:Type vm:AcceptedFutureBookingsViewModel}}, Path=BookingTapped}"
  93. CommandParameter="{Binding .}">
  94. </TapGestureRecognizer>
  95. <!--<TapGestureRecognizer Tapped="OnBookingViewClicked"/>-->
  96. </Frame.GestureRecognizers>
  97. </Frame>
  98. </DataTemplate>
  99. </CollectionView.ItemTemplate>
  100. </CollectionView>
  101. </Frame>
  102. <Button VerticalOptions="EndAndExpand"
  103. Margin="40,0,40,15"
  104. Text="Refresh"
  105. FontSize="20"
  106. TextColor="White"
  107. Command="{Binding OnRefreshClicked}"/>
  108. </StackLayout>
  109. </ContentPage.Content>
  110. </ContentPage>