views:

88

answers:

1

Hello,

I have created a user interface for my Silverlight application in Blend. This application is currently using some sample data that I created within Blend. I need to do something with this sample data at runtime.

How do I access sample data that has been created in Blend at runtime?

Thank you!

A: 

Hi,

Typically this sample data is added as application resource with SampleDataSource as key. This means that you can access it like this:

((SampleDataSource)Application.Current.Resources["SampleDataSource"]).Collection

Note that SampleDataSource class is located in Expression.Blend.SampleData.SampleDataSource namespace so a using may be needed.

ligaz