-
Notifications
You must be signed in to change notification settings - Fork 2
/
FavoritesPage.xaml
55 lines (55 loc) · 3 KB
/
FavoritesPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BikeAvailability.FavoritesPage"
Title="Favorites">
<Grid>
<CollectionView x:Name="FavoritesList"
SelectionMode="Single"
HeightRequest="800" HorizontalOptions="Start" VerticalOptions="Start"
ItemsSource="{Binding FavoriteList}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="88" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="88" />
</Grid.ColumnDefinitions>
<Image Grid.Row="1" Grid.RowSpan="3"
Source="{Binding Attributes[ImageUrl]}"
Margin="0,-22,0,0"
Aspect="AspectFill"
HeightRequest="50"
WidthRequest="50" />
<Button Grid.Column="0" Grid.ColumnSpan="3"
Text="{Binding Attributes[StationName]}"
MinimumWidthRequest="300"
FontAttributes="Bold"
Clicked="StationClicked"/>
<Label Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Margin="20,2"
Text="{Binding Attributes[BikesAvailable], StringFormat='Bikes: {0}'}" />
<Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
Margin="20,2"
Text="{Binding Attributes[EBikesAvailable], StringFormat='E-Bikes: {0}'}" />
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
Margin="2,7"
Text="{Binding Attributes[TimeStamp], StringFormat = 'Updated {0:h:mm:ss tt}'}"
FontAttributes="Italic" />
<Label Grid.Row="3" Grid.Column="2"
Margin="2,7"
Text="{Binding Attributes[InventoryChange], StringFormat='Change: {0}'}"
FontAttributes="Bold" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>