我在尝试获取要构建的TodoASMX解决方案时遇到问题。
具体来说,我在PCL中遇到了List Page(xaml)的问题。我已经包含了屏幕截图,因此您可以看到xaml和相应的cs文件。
我的XAML ......
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Core.Views.TeamMemberListPage">
<ContentPage.Content>
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="20,0,0,0" HorizontalOptions="StartAndExpand" Orientation="Horizontal">
<Label Text="{Binding Name}" VerticalTextAlignment="Center" />
<Image Source="check.png" IsVisible="{Binding Done}" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
</ContentPage>
我的XAML代码隐藏......
using Xamarin.Forms;
namespace GreystarApps.Core.Views
{
public partial class TeamMemberListPage : ContentPage
{
bool alertShown = false;
public TeamMemberListPage()
{
InitializeComponent ();
}
protected async override void OnAppearing()
{
base.OnAppearing();
if (Constants.SoapUrl.Contains("developer.xamarin.com"))
{
if (!alertShown)
{
await DisplayAlert(
"Hosted Back-End",
"This app is running against Xamarin's read-only ASMX service. To create, edit, and delete data you must update the service endpoint to point to your own hosted ASMX service.",
"OK");
alertShown = true;
}
}
listView.ItemsSource = await App.tmManager.GetTeamMembersAsync();
}
}
}
只需在VS中查看“InitializeComponent()”和“listView.ItemSource ...”行标有下划线并在设计时显示为错误,但它们在我从GitHub下载的原始TodoASMX解决方案中也显示为错误。然而,TodoASMX解决方案实际上是建立的,而我的解决方案没有。