如何在Xamarin Forms跨平台中绑定图像集合 [英] How to bind collection of images in Xamarin Forms Cross-Platform
本文介绍了如何在Xamarin Forms跨平台中绑定图像集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在WPF
中,我可以轻松地将图像源集合绑定到具有图像模板的WrapPanel
上,例如:
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>
我找不到将Image
集合绑定到任何基于面板的控件的另一种Cross-platform Xamarin Forms
方式.
I cannot find an alternative Cross-platform Xamarin Forms
way of binding my Image
collection to any panel based control.
推荐答案
Xamarin.Forms实验室中的ItemsControl
等效项称为RepeaterView
.它支持项DataTemplate
以及ItemsPanelTemplate.在GitHub上查看维基页面,并在此
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
这篇关于如何在Xamarin Forms跨平台中绑定图像集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文