Blend - PropertyChanges 没有更新
我在 Silverlight 中有一个自定义控件,在我再次构建应用程序之前,通过属性窗口更改属性不会更新。可能是什么问题?
举例说吧。我有一个名为“形状”的控件。如果我选择形状类型为“辛烷值”,它应该在混合设计时表面中显示辛烷值示例。
但是,就我而言,这种情况没有发生,混合设计器不会得到更新,直到我再次构建应用程序。请就此向我提出建议。 我不想让消费者因财产价值的每一次变化而建造它,从而给他们带来麻烦。
注意:控件中所有公开的属性都是依赖属性。
I have a custom control in Silverlight, the change of property via property window is not getting updated until I build the application once again. What could be the problem?
Say for example. I have a control called Shapes. If I select type of the shape as "Octane" it should show a sample octane in blend design-time surface.
But, in my case it is not happening, the blend designer is not getting updated untill I build the application again. Please advice me on this.
I don't want to put the consumer in trouble by letting them build it for every change in property value they make.
Note: All the exposed properties in the control are dependency property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我拥有的是用于应用样式的
CommonStyles
类型的属性。例如,CommonStyles
将包含 dp,如背景、前景、厚度等,我犯的错误是,我直接分配了如下值。在基础班。 [ShapeStyle 是 CommonStyle 类型的 dp]
当我更改背景属性时,它不会更新我的
ShapeBase.Background
属性。因为,它不受依赖关系的约束。我通过 dp 绑定解决了这个问题。就像下面这样。
What I had was a Properties of type
CommonStyles
for applying styles. For example,CommonStyles
will contains dp's like Background, Foreground, Thickness, etc.,The mistake I done was, I directly assigned the values like below. In base class. [ShapeStyle is a dp of type CommonStyle]
When, I change the background property it won't update my
ShapeBase.Background
property. Since, it is not dependency bound.I resolved it by, dp binding. Like below.
您是否实现了属性的设置器,以便在属性值更改时控件会更新?
(顺便说一句,只是因为我很好奇,辛烷形状是什么?它与化学有关吗?)
Have you implemented the setter of your property so that the controls update when the property's value is changed?
(BTW, just because I'm curious, what's an octane shape? does it have something to do with chemistry?)