C# 如何跨平台绑定Xamarin表单中的图像集合
在C# 如何跨平台绑定Xamarin表单中的图像集合,c#,wpf,xaml,binding,xamarin-forms,C#,Wpf,Xaml,Binding,Xamarin Forms,在WPF中,我可以使用图像模板轻松地将图像源集合绑定到WrapPanel,例如: <ItemsControl ItemsSource="{Binding YourChildItems}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapPanel/> </ItemsPanelTemplate> </It
WPF
中,我可以使用图像模板轻松地将图像源集合绑定到WrapPanel
,例如:
<ItemsControl ItemsSource="{Binding YourChildItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
我找不到一种替代的
跨平台Xamarin表单
方法将我的图像
集合绑定到任何基于面板的控件。Xamarin中有一种与ItemsControl
等效的方法。表单实验室称为RepeaterView
。它支持itemDataTemplate
和ItemsPanelTemplate。查看GitHub上的和此上的示例
WrapLayout.cs
xmlns:xf=“clr名称空间:Xamarin.Forms”
感谢您告诉我们关于
RepeaterView
。我不知道这件事。
<ScrollView>
<xf:WrapLayout x:Name="wrp" />
</ScrollView>