【发布时间】:2010-11-23 10:01:47
【问题描述】:
大家好,我在尝试设置中继器时得到了一些帮助,但当我测试他的代码时,它仍然无法正常工作显示什么是什么,
我有一个 XML Feed,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 = "";
}
我希望能够 foreach Comments.cmets 并将其传递给转发器,以便 XAML 重复内部的代码块,转发器并使用 {binding text} 作为文本框的值深度代码检查下面的链接
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);
【问题讨论】:
-
我不认为这个问题可以归结为一点,可以吗?您是否需要一些特定的功能来帮助您编写解决方案?
-
这个问题只是stackoverflow.com/questions/4203471/…的重复吗?
-
不,我要求任何工作示例,所以我可以重新创建以修复我的代码。
标签: c# silverlight xaml windows-phone-7