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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement