【发布时间】:2017-07-08 02:15:42
【问题描述】:
我制作了一个 xamarin 跨平台应用程序,它从 web api 返回项目列表。 xaml 代码如下所示:
<ViewModels:ItemViewModel/>
</ContentPage.BindingContext>
<ListView ItemsSource="{Binding ItemsList}"
HasUnevenRows="True"
x:Name="lstItems"
ItemTapped="LstItems_OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding ItemCode}" x:Name="lblItemCode" FontSize="Medium" TextColor="Blue"/>
<Label Text="{Binding ItemDesc}" FontSize="Medium" TextColor="Blue"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
我需要将 ItemCode 作为参数传递到下一页。 我怎样才能做到这一点?我在 xaml 页面中写了什么,我在后面的代码中写了什么? 帮助将不胜感激
【问题讨论】:
标签: xaml xamarin xamarin.forms