通过继承来设计附加属性
我的问题与此类似: WPF Style with no target type? 但问题是我的是一个附加属性:
<Style TargetType="Shape" >
<Setter Property="z:Zommable.Unscale" Value="StrokeThickness" />
</Style>
我的目标是:从形状派生的所有对象都必须具有带有值的附加属性 Zommable.Unscale ,但我找不到如何做到这一点。 谢谢 !
My question is similar to this: WPF Style with no target type? but the problem is that mine is an attached property:
<Style TargetType="Shape" >
<Setter Property="z:Zommable.Unscale" Value="StrokeThickness" />
</Style>
My goal is: all object deriving from shape must have the attached property Zommable.Unscale with a value, but I can't find how to do it.
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与其他问题没有区别。您必须完全做同样的事情。因此,对于从 Shape 派生的每个类,您必须使用具有该目标类型的样式,该目标类型基于您的样式和附加属性。
所以它会是:
there is no difference to the other question. you will have to do exactly the same. So for each class deriving from Shape you will have to use a Style with that targettype that's BasedOn your style with your attached property.
So it's gonna be: