简体   繁体   中英

C# WP7 Silverlight Repeater Not Working,

Hi All I got some help with trying to set-up a repeater and when i tested his code it still does not work i have tried code from MSDN so can any one show me working code so i can provide a use a repeater to show what's what,

What i have is an XML Feed, http://spiked.appware.co.uk/xml/comments/get/5/

These are then loaded into a variable inside an object

comment[] Comments.comments

public class comment
{
   public string text = "";
   public string device = "";
   public string name = "";
   public string id = "";
}

I want to be able to foreach the Comments.comments and pass it though to a repeater so that the XAML repeats the code block inside, the repeter and uses the {binding text} as the value of a text box for in-depth code check the link below

Data binding no error but the binding is not outputting

FOR FIRST ANSWER

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); 

What are you using for your repeater?

Have you looked at the default "DataBound" application template? This displays a collection of objects in a ListBox using data binding.
It sounds like you're trying to do the same thing, only your collection (array) is first populated by parsing an XML feed.

Edit:
Assuming that this question is a continuation of Data binding no error but the binding is not outputting
I've now got a complete working example available for download at http://cid-cc22250598bf7f04.office.live.com/self.aspx/Public/ShowCommentsDemo.zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM