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.
 
 
 

35 lines
1.7 KiB

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="CollectionViewDemos.Views.FifthPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:CollectionViewDemos.ViewModels"
Title="fifthPage">
<ContentPage.BindingContext>
<viewModels:AnimalsViewModel />
</ContentPage.BindingContext>
<Grid Margin="20">
<CollectionView ItemsSource="{Binding Animals}"
RemainingItemsThreshold="5" RemainingItemsThresholdReached="CollectionView_RemainingItemsThresholdReached"
RemainingItemsThresholdReachedCommand="{Binding LoadMoreDataCommand}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10"
ColumnDefinitions="Auto, Auto" RowDefinitions="Auto, Auto">
<Image Grid.RowSpan="2"
Aspect="AspectFill" HeightRequest="60"
Source="{Binding ImageUrl}"
WidthRequest="{Binding Source={RelativeSource Mode=Self}, Path=WidthRequest}" />
<Label Grid.Column="1"
FontAttributes="Bold"
Text="{Binding Name}" />
<Label Grid.Row="1" Grid.Column="1"
FontAttributes="Italic"
Text="{Binding Location}"
VerticalOptions="End" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>