我正在尝试使用新的 xamarin.forms.pages.listdatapage Controt
我遵循"入门"页面上的说明,从数据开始开始,以设置 azureAsyTableSource 。该应用程序编译和运行,但是this.DataSource.Data.Count
总是在iOS和Android上返回0。
波纹管是视图xaml
<?xml version="1.0" encoding="UTF-8"?>
<p:ListDataPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Sparrow"
xmlns:azure="clr-namespace:Xamarin.Forms.Pages.Azure;assembly=Xamarin.Forms.Pages.Azure"
xmlns:p="clr-namespace:Xamarin.Forms.Pages;assembly=Xamarin.Forms.Pages"
x:Class="Sparrow.NewsPage" StyleClass="Event" Title="News" BindingContext="This">
<p:ListDataPage.DataSource>
<azure:AzureDataSource>
<azure:AzureDataSource.Source>
<azure:AzureEasyTableSource TableName="NewsItem"
Uri="https://<<AppName>>.azurewebsites.net"/>
</azure:AzureDataSource.Source>
</azure:AzureDataSource>
</p:ListDataPage.DataSource>
<p:ListDataPage.DefaultItemTemplate>
<DataTemplate>
<ViewCell>
<p:ListItemControl
Title="{ Binding Value[headline] }"
Detail="{ Binding Value[newsBody] }"
DataSource="{ Binding Value }"
HeightRequest="30"
/>
</ViewCell>
</DataTemplate>
</p:ListDataPage.DefaultItemTemplate>
</p:ListDataPage>
wireshark捕获和应用程序服务流日志显示服务器正在接收和响应请求,但是应用程序未能处理数据。
看来,您的数据绑定也许是一个问题,因为它们应该与即将出现的值相对应并需要特殊语法。这是我从我的OCR样本中获取的一个示例:https://github.com/jamesmontemagno/app-ocr-functions:
<p:CardView
Margin="10"
Text="Total Amount from OCR:"
Detail="{p:DataSourceBinding Total}"
ImageSource="{p:DataSourceBinding Url}"
DataSource="{Binding Value}"
HeightRequest="250"/>
</ViewCell>
您必须使用p:dataSourceBinding to it it it it dataSourceBinding。