开发者

Overriding ActualWidth and ActualHeight dependency properties

I have a custom line shape with start and end point. The ActualWidth and ActualHeight properties however do not return the correct value, that is the difference between the points. Is there a way to overrid开发者_如何学Goe these properties in the derived class, and how would you go about doing it. I need to use the ActualWidth and ActualHeight properties since I am using an algorithm which uses those properties for other shapes.


You can't override ActualWidth and ActualHeight, they are computed:

The value is set by the layout system itself, based on an actual rendering pass

So, what you should do instead is to change how your shape behaves during rendering. Either by the way you override DefiningGeometry (assuming your shape is actually Shape) or by overriding MeasureOverride().

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜