开发者

Silverlight/WPF and Blend: DataBind a text field, but define a design-time value?

开发者 https://www.devze.com 2022-12-17 02:32 出处:网络
Hopefully this is simple - I DataBind a bunch of labels and text controls in a Silverlight application (to DependencyProperties that I create in my class), but of course the text is empty at design ti

Hopefully this is simple - I DataBind a bunch of labels and text controls in a Silverlight application (to DependencyProperties that I create in my class), but of course the text is empty at design time.

I'd still like to have an idea of how this will be laid out; is t开发者_运维问答here a way to specify a design-time value, even though it's databound?


The feature you're looking for is Expression Blend Sample Data. Sample Data allows you to specify a Design Time data source that has some sample fields in it (names, addresses, numbers, images, hierarchies, etc).

Here's a good introduction article: http://silverzine.com/tutorials/how-to-create-sample-data-in-blend-3/

And here's a collection of links on Sample data: http://martinkruszynski.blogspot.com/2009/08/expression-blend-3-sample-data-data.html

The core of Sample Data is you use build a mock design time datasource in blend (shaped like your data types), define the type of sample data and the bindings get evaluated to give you a meaningful design time experience.

0

精彩评论

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

关注公众号