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.

92 lines
5.0 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.CouponHistoryPage"
  5. xmlns:vm="clr-namespace:GMCabsDriverAssistantSolution.ViewModels"
  6. Title="{Binding Title}">
  7. <ContentPage.BindingContext>
  8. <vm:CouponHistoryViewModel />
  9. </ContentPage.BindingContext>
  10. <ContentPage.Resources>
  11. <ResourceDictionary>
  12. <Color x:Key="Accent">#96d1ff</Color>
  13. <Style x:Key="LabelStyle" TargetType="Label">
  14. </Style>
  15. </ResourceDictionary>
  16. </ContentPage.Resources>
  17. <ContentPage.Content>
  18. <StackLayout Orientation="Vertical"
  19. BackgroundColor="#DCDCDC"
  20. Padding="8">
  21. <Label Text="Coupon History"
  22. FontSize="25"
  23. TextColor="Black"
  24. Margin="10,30,0,10"/>
  25. <CollectionView ItemsSource="{Binding CouponsHistory}">
  26. <CollectionView.ItemsLayout>
  27. <LinearItemsLayout
  28. ItemSpacing="10"
  29. Orientation="Vertical"/>
  30. </CollectionView.ItemsLayout>
  31. <CollectionView.ItemTemplate>
  32. <DataTemplate>
  33. <StackLayout Padding="5,0,5,0">
  34. <Frame
  35. CornerRadius="24"
  36. Padding="10"
  37. BackgroundColor="White">
  38. <StackLayout Orientation="Horizontal">
  39. <Frame Padding="0"
  40. CornerRadius="8">
  41. <Label Text="{Binding CouponText}"
  42. Padding="5,5,5,5"
  43. HorizontalOptions="Start"
  44. LineBreakMode="NoWrap"
  45. FontSize="Caption"
  46. TextTransform="Uppercase"
  47. VerticalTextAlignment="Center"
  48. BackgroundColor="{Binding CouponBackgroundColor}"
  49. Style="{StaticResource LabelStyle}"
  50. TextColor="White"/>
  51. </Frame>
  52. <Label Text="{Binding RedeemedLocation}"
  53. VerticalTextAlignment="Center"
  54. HorizontalOptions="Start"
  55. FontSize="Body"
  56. TextColor="Black"/>
  57. <Label
  58. VerticalTextAlignment="Center"
  59. HorizontalOptions="EndAndExpand"
  60. FontSize="Body"
  61. TextColor="Black">
  62. <Label.Triggers>
  63. <DataTrigger TargetType="Label" Binding="{Binding isRedemed}" Value="True">
  64. <Setter Property="Text" Value="{Binding RedeemedDate, StringFormat='{0:dd-MM}'}"/>
  65. </DataTrigger>
  66. <DataTrigger TargetType="Label" Binding="{Binding isRedemed}" Value="False">
  67. <Setter Property="Text" Value="{Binding ExpiryDate, StringFormat='{0:dd-MM}'}" />
  68. </DataTrigger>
  69. </Label.Triggers>
  70. </Label>
  71. </StackLayout>
  72. </Frame>
  73. </StackLayout>
  74. </DataTemplate>
  75. </CollectionView.ItemTemplate>
  76. <CollectionView.EmptyView>
  77. <ContentView>
  78. <StackLayout Orientation="Vertical"
  79. VerticalOptions="CenterAndExpand">
  80. <Image Source="support"
  81. HeightRequest="70"/>
  82. <Label Text="{Binding LoadingText}"
  83. TextColor="Black"
  84. FontSize="20"
  85. HorizontalTextAlignment="Center"
  86. VerticalTextAlignment="Center"/>
  87. </StackLayout>
  88. </ContentView>
  89. </CollectionView.EmptyView>
  90. </CollectionView>
  91. </StackLayout>
  92. </ContentPage.Content>
  93. </ContentPage>