Silverlight/WPF 和 Blend:DataBind 文本字段,但定义设计时值?

发布于 2024-08-18 07:04:59 字数 144 浏览 2 评论 0原文

希望这很简单 - 我在 Silverlight 应用程序中 DataBind 一堆标签和文本控件(到我在类中创建的 DependencyProperties),但当然文本在设计时是空的。

我仍然想知道这将如何安排;有没有办法指定设计时值,即使它是数据绑定的?

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 there a way to specify a design-time value, even though it's databound?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ˇ宁静的妩媚 2024-08-25 07:04:59

您正在寻找的功能是“表达式混合示例数据”。
示例数据允许您指定其中包含一些示例字段(名称、地址、数字、图像、层次结构等)的设计时数据源。

这是一篇很好的介绍文章:
http://silverzine.com/tutorials/how -to-create-sample-data-in-blend-3/

以下是示例数据的链接集合:
http://martinkruszynski.blogspot.com/ 2009/08/expression-blend-3-sample-data-data.html

示例数据的核心是您使用在混合中构建模拟设计时数据源(形状像您的数据类型),定义示例的类型数据和绑定经过评估,可为您提供有意义的设计时体验。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文