PDA

View Full Version : How do I update Sample Data in C#?


Zhang JingChu
09-23-2011, 07:21 PM
How do I update Sample Data in C#?

I have this sample data. Right now it is defined in a seperate C# file like this:
public class SampleData
{

public static ObservableCollection<Product> GetSampleData()
{
ObservableCollection<Product> teams = new ObservableCollection<Product>();
}
}

and I load the obsevableCollection inside GetSampleData().

It works and I am able to get the sample data anywhere in my program.

But how can I redesign this code so that I can create the sample data on the fly from outside the class?

wisemx
09-24-2011, 04:29 AM
These two posts should help:
http://www.jigar.net/articles/viewhtmlcontent328.aspx

http://weblogs.asp.net/jigardesai/archive/2008/11/02/display-live-data-in-silverlight-using-observablecollection-and-inotifypropertychanged.aspx