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.

104 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.CouponsPage"
  5. xmlns:models="clr-namespace:GMCabsDriverAssistantSolution.ViewModels"
  6. Title="{Binding Title}"
  7. Shell.FlyoutBehavior="Disabled">
  8. <ContentPage.Resources>
  9. <ResourceDictionary>
  10. <Color x:Key="Accent">#96d1ff</Color>
  11. </ResourceDictionary>
  12. </ContentPage.Resources>
  13. <ContentPage.Content>
  14. <StackLayout Orientation="Vertical"
  15. BackgroundColor="#DCDCDC">
  16. <StackLayout Orientation="Horizontal"
  17. Margin="20,40,20,30">
  18. <Label Text="Available Coupons"
  19. FontSize="25"
  20. TextColor="Black"
  21. VerticalTextAlignment="Center"
  22. HorizontalOptions="StartAndExpand"/>
  23. <ImageButton Source="sync.png"
  24. HeightRequest="30"
  25. BackgroundColor="Transparent"
  26. HorizontalOptions="EndAndExpand"
  27. Command="{Binding SyncCouponCommand}"/>
  28. </StackLayout>
  29. <CarouselView
  30. ItemsSource="{Binding Coupons}"
  31. Loop="False"
  32. EmptyView ="{Binding EmptyViewMessage}"
  33. PeekAreaInsets="40">
  34. <!--<CarouselView.EmptyView>
  35. <ContentView >
  36. <StackLayout
  37. Orientation="Vertical"
  38. HorizontalOptions="CenterAndExpand"
  39. VerticalOptions="CenterAndExpand"
  40. >
  41. <Image
  42. Source="support"
  43. HorizontalOptions="Center"
  44. HeightRequest="70"/>
  45. <Label
  46. Text="{Binding EmptyViewMessage}"
  47. TextColor="Black"
  48. FontSize="20"
  49. HorizontalTextAlignment="Center"
  50. VerticalTextAlignment="Center"/>
  51. </StackLayout>
  52. </ContentView>
  53. </CarouselView.EmptyView>-->
  54. <CarouselView.ItemTemplate>
  55. <DataTemplate>
  56. <StackLayout>
  57. <Frame
  58. HasShadow="True"
  59. BorderColor="DarkGray"
  60. CornerRadius="12"
  61. Margin="8"
  62. HorizontalOptions="Center"
  63. VerticalOptions="StartAndExpand"
  64. BackgroundColor="White">
  65. <StackLayout>
  66. <Label
  67. Text="{Binding ExpiryDate, StringFormat='Expires: {0:dd/MM/yyyy}'}"
  68. HorizontalOptions="Center"
  69. VerticalOptions="Center"
  70. MaxLines="1"
  71. TextColor="Black"
  72. FontSize="16"/>
  73. <Grid HeightRequest="240"
  74. WidthRequest="240">
  75. <ActivityIndicator IsRunning="True"
  76. IsVisible="true"
  77. Scale="0.5"/>
  78. <Image
  79. Source="{Binding Image}"
  80. Aspect="AspectFit"
  81. HorizontalOptions="Center"
  82. Margin="8,0" />
  83. </Grid>
  84. <Label Text="{Binding Amount, StringFormat='${0:#.00}'}"
  85. TextColor="Black"
  86. HorizontalOptions="Center"
  87. FontSize="28"/>
  88. </StackLayout>
  89. </Frame>
  90. </StackLayout>
  91. </DataTemplate>
  92. </CarouselView.ItemTemplate>
  93. </CarouselView>
  94. <Button VerticalOptions="EndAndExpand"
  95. Margin="40,0,40,15"
  96. Text="View History"
  97. FontSize="20"
  98. Clicked="OnCouponHistoryViewClicked"/>
  99. </StackLayout>
  100. </ContentPage.Content>
  101. </ContentPage>