How do I update Sample Data in C#?

Discussion in 'Silverlight' started by Zhang JingChu, Sep 23, 2011.

  1. 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?
     

Share This Page