Reputation: 1733
In WPF
, I can easily bind a collection of image sources to a WrapPanel
with image template for instance:
<ItemsControl ItemsSource="{Binding YourChildItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
I cannot find an alternative Cross-platform Xamarin Forms
way of binding my Image
collection to any panel based control.
Upvotes: 1
Views: 1430
Reputation: 5202
Go to here and download WrapLayout.cs
.
Add it your project in Visual Studio.
Then you should define its namespace in xaml
xmlns:xf="clr-namespace:Xamarin.Forms"
You should use it like this code:
<ScrollView>
<xf:WrapLayout x:Name="wrp" />
</ScrollView>
Upvotes: 0
Reputation: 4839
There is an equivalent of ItemsControl
in Xamarin.Forms labs called RepeaterView
. It has support for item DataTemplate
as well as ItemsPanelTemplate. Check the wiki page on GitHub and this forum thread for examples
Upvotes: 1