【发布时间】:2017-11-17 23:23:45
【问题描述】:
我有以下 ListView 和相关模板:
listView = new ListView()
{
ItemTemplate = dtemplate
};
listView.SetBinding(ListView.ItemsSourceProperty, new Binding("Items"));
var dtemplate = new DataTemplate(() =>
{
var stacklayout = new StackLayout()
{
Orientation = StackOrientation.Horizontal
};
var lbl = new Label();
lbl.SetBinding(Label.TextProperty, new Binding("Title")); //<-- this
stacklayout.Children.Add(lbl);
return new ViewCell { View = stacklayout };
});
参考标有“//
【问题讨论】:
标签: xamarin xamarin.forms