0
我已經收集了我的每個客戶的所有信息,並希望在我的初始視圖listView中填充CustomerID信息。不過,我認爲我處於對象的頂層,我不知道如何在我的listView上獲取CustomerID信息。ListView對象並將數據傳遞到Xamarin表單中的下一個視圖
此外我想將選定的物品信息傳遞到下一個視圖來顯示剩餘的相應客戶信息。
private IEnumerable <IDictionary<string,object>> myData;
List <Customer> list= new List<Customer>();
var listView= new ListView();
foreach (var customers in myData) {
list.Add(new Customer((string)customers["CustomerID"],
(string)customers ["CompanyName"],
(string)customers ["ContactName"],
(string)customers ["ContactTitle"],
(string)customers ["Address"],
(string)customers ["Region"],
(string)customers ["PostalCode"],
(string)customers ["City"],
(string)customers ["Fax"],
(string)customers ["Phone"]
));
}
listView.ItemsSource=list;
SearchBar searchBar = new SearchBar
{
Placeholder = "Xamarin.Forms Property",
};
Padding = new Thickness (10, 20, 10, 10);
Content = new StackLayout() {
Children={searchBar,listView}
};
listView.ItemSelected += (sender, e) => {
//my next view is DetailPage
};
http://stackoverflow.com/questions/26407176/odata-hangs-forever-in-xamarin-form – casillas 2014-10-16 14:46:47