【发布时间】:2016-09-06 00:20:01
【问题描述】:
我确信这很容易做到,但我被困住了......我到处寻找一种方法来填充 Xamarin Android 中的列表视图。 这是我的代码:
public class MainActivity : Activity { WipService.BasicHttpBinding_IWipService client; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button getsomebtn = FindViewById<Button>(Resource.Id.GetSomeBtn); ListView applist = FindViewById<ListView>(Resource.Id.AppList); getsomebtn.Click += Getsomebtn_Click; } private void Getsomebtn_Click(object sender, EventArgs e) { client = new WipService.BasicHttpBinding_IWipService(); client.GetWorkerListCompleted += Client_GetWorkerListCompleted; client.GetWorkerListAsync(); } public void Client_GetWorkerListCompleted(object sender, WipService.GetWorkerListCompletedEventArgs e) { var x = e.Result; }
WCF 服务运行良好!!!我在“x”中得到列表,见下图。
我的问题是如何填充我的名为 applist 的 ListView ???
【问题讨论】:
标签: c# android wcf listview xamarin.android