These are just placement reasons: adorners are usually placed at the corners of an element and therefore you have to know the width and height of it. As it's possible that the element is not completely drawn at this time you have to use the DesiredSize properties in order to get the correct size of the adorned element.
Example: Assume the elements width = 100 and the adorners width = 8. You usually want to place the left upper adorner with its center on the corner. Therefore you have to place it at Element.Left - 4 (=Adorner.Width / 2):
topLeft.Arrange(new Rect(-adornerWidth / 2, -adornerHeight / 2, adornerWidth, adornerHeight));
Gerhard
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only