Skip to content

Instantly share code, notes, and snippets.

@rasmuschristensen
Created May 4, 2017 14:16
Show Gist options
  • Save rasmuschristensen/06936c5c389a40b1f2e586e5d9d56a75 to your computer and use it in GitHub Desktop.
Save rasmuschristensen/06936c5c389a40b1f2e586e5d9d56a75 to your computer and use it in GitHub Desktop.
How to use WrapPanel
<ScrollView>
<appControls:WrapLayout
Margin="2"
VerticalOptions="FillAndExpand"
Spacing="6"
RowSpacing="10"
MaxColumns="3"
ItemsSource="{Binding Ads}"
x:Name="thelist">
<appControls:WrapLayout.ItemTemplate>
<DataTemplate>
<Grid
RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition
Height="auto">
</RowDefinition>
<RowDefinition
Height="20">
</RowDefinition>
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Source="{Binding Image}"
Aspect="AspectFill">
<Image.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding BindingContext.AdSelected, Source={x:Reference adListPage}}"
CommandParameter="{Binding .}" />
</Image.GestureRecognizers>
</Image>
<Label
Grid.Row="1"
HeightRequest="20"
StyleClass="AdListInfo"
VerticalOptions="End"
HorizontalTextAlignment="End"
Text="{Binding Price}">
</Label>
</Grid>
</DataTemplate>
</appControls:WrapLayout.ItemTemplate>
</appControls:WrapLayout>
</ScrollView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment