嗨,我在设置中继器方面得到了一些帮助,当我测试他的代码时,它仍然不起作用。我尝试过来自msdn的代码,所以任何人都可以向我显示工作代码,这样我就可以提供一个使用中继器来显示什么是什么,
我有一个XML提要,
http://spiked.appware.co.uk/xml/comments/get/5/
然后将它们加载到对象内的变量中
comment[] Comments.comments
public class comment
{
public string text = "";
public string device = "";
public string name = "";
public string id = "";
}
我希望能够预先调用comments.comments并将其传递给转发器,以便XAML在repeter内重复代码块,并使用绑定文本作为深度代码文本框的值选中下面的链接
Data binding no error but the binding is not outputting
第一个答案
var comments = new Comments();
var threeComments = new List<Comment>
{
new Comment("t1", "d1", "n1", "i1"),
new Comment("t2", "d2", "n2", "i3"),
new Comment("t3", "d3", "n3", "i3")
};
comments.comments = threeComments.ToArray();
commentsLooper.ItemsSource = new CommentsDataItems(comments);