开发者

Silverlight and Blend - How do I programmatically access sample data?

开发者 https://www.devze.com 2022-12-16 18:34 出处:网络
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

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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号