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 override 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.
I have a custom line shape with start and end point. The ActualWidth and
Share
You can’t override
ActualWidthandActualHeight, they are computed: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 actuallyShape) or by overridingMeasureOverride().