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.

138 lines
8.1 KiB

  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.BookingsPage"
  5. xmlns:cmp="clr-namespace:Microsoft.Maui.Controls.Compatibility;assembly=Microsoft.Maui.Controls"
  6. xmlns:vm="clr-namespace:GMCabsDriverAssistantSolution.ViewModels" x:DataType="vm:BookingsViewModel"
  7. xmlns:models="clr-namespace:GMCabsDriverAssistant.Models"
  8. Title="{Binding Title}">
  9. <ContentPage.Resources>
  10. <ResourceDictionary>
  11. <Color x:Key="Accent">#96d1ff</Color>
  12. </ResourceDictionary>
  13. </ContentPage.Resources>
  14. <ContentPage.Content>
  15. <StackLayout Orientation="Vertical"
  16. BackgroundColor="#DCDCDC"
  17. x:DataType="vm:BookingsViewModel">
  18. <Frame Margin="10,40,10,10"
  19. CornerRadius="10"
  20. BackgroundColor="#E8E8E8">
  21. <CollectionView ItemsSource="{Binding Bookings}">
  22. <CollectionView.ItemsLayout>
  23. <LinearItemsLayout
  24. Orientation="Vertical"
  25. ItemSpacing="10"
  26. />
  27. </CollectionView.ItemsLayout>
  28. <CollectionView.ItemTemplate>
  29. <DataTemplate>
  30. <cmp:RelativeLayout>
  31. <Frame x:DataType="models:BookingDto"
  32. CornerRadius="10"
  33. BackgroundColor="{StaticResource Primary}"
  34. Margin="0, 30, 0, 0"
  35. Padding="8">
  36. <StackLayout Orientation="Vertical" Margin="0,10,0,0">
  37. <Grid>
  38. <Grid.ColumnDefinitions>
  39. <ColumnDefinition Width="Auto"/>
  40. <ColumnDefinition Width="1*"/>
  41. </Grid.ColumnDefinitions>
  42. <Label Grid.Row="0"
  43. Grid.Column="0"
  44. Text="{Binding StartSuburb}"
  45. TextColor="White"
  46. FontFamily="Bold"
  47. HorizontalOptions="StartAndExpand"
  48. FontSize="17"/>
  49. <Label
  50. Grid.Row="0"
  51. Grid.Column="1"
  52. VerticalTextAlignment="Center"
  53. HorizontalOptions="EndAndExpand"
  54. FontSize="17"
  55. TextColor="White">
  56. <Label.Triggers>
  57. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="True">
  58. <Setter Property="Text" Value="{Binding FormattedPickUpTimeDateOnly}"/>
  59. </DataTrigger>
  60. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="False">
  61. <Setter Property="Text" Value="{Binding FormattedDistance}" />
  62. </DataTrigger>
  63. </Label.Triggers>
  64. </Label>
  65. <Label Grid.Row="1"
  66. Grid.Column="0"
  67. Text="{Binding EndSuburb}"
  68. TextColor="White"
  69. FontFamily="Bold"
  70. HorizontalOptions="StartAndExpand"
  71. FontSize="17"/>
  72. <Label
  73. Grid.Row="1"
  74. Grid.Column="1"
  75. VerticalTextAlignment="Center"
  76. HorizontalOptions="EndAndExpand"
  77. FontSize="17"
  78. TextColor="White">
  79. <Label.Triggers>
  80. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="True">
  81. <Setter Property="Text" Value="{Binding FormattedPickUpTimeTimeOnly}" />
  82. </DataTrigger>
  83. <DataTrigger TargetType="Label" Binding="{Binding FutureBooking}" Value="False">
  84. <Setter Property="Text" Value="ASAP" />
  85. </DataTrigger>
  86. </Label.Triggers>
  87. </Label>
  88. </Grid>
  89. </StackLayout>
  90. <Frame.GestureRecognizers>
  91. <TapGestureRecognizer
  92. NumberOfTapsRequired="1"
  93. Command="{Binding Source={RelativeSource AncestorType={x:Type vm:BookingsViewModel}}, Path=BookingTapped}"
  94. CommandParameter="{Binding .}">
  95. </TapGestureRecognizer>
  96. <!--<TapGestureRecognizer Tapped="OnBookingViewClicked"/>-->
  97. </Frame.GestureRecognizers>
  98. </Frame>
  99. <Frame x:DataType="models:BookingDto"
  100. IsVisible="{Binding IsSeenBooking}"
  101. CornerRadius="10"
  102. BackgroundColor="#B40431"
  103. Padding="8,4"
  104. Margin="9 ,16"
  105. cmp:RelativeLayout.XConstraint=
  106. "{cmp:ConstraintExpression
  107. Type=RelativeToParent,
  108. Property=Width,
  109. Factor=1,
  110. Constant=-75
  111. }">
  112. <Label Grid.Row="0"
  113. Grid.Column="0"
  114. Text="NEW"
  115. TextColor="White"
  116. FontFamily="Bold"
  117. HorizontalOptions="StartAndExpand"
  118. FontSize="16"/>
  119. </Frame>
  120. </cmp:RelativeLayout>
  121. </DataTemplate>
  122. </CollectionView.ItemTemplate>
  123. </CollectionView>
  124. </Frame>
  125. <Button VerticalOptions="EndAndExpand"
  126. Margin="40,0,40,15"
  127. Text="REFRESH"
  128. FontSize="20"
  129. Visual="Default"
  130. TextColor="White"
  131. Command="{Binding OnRefreshClicked}"/>
  132. </StackLayout>
  133. </ContentPage.Content>
  134. </ContentPage>