Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adorners in WPF
Message
General information
Forum:
ASP.NET
Category:
Forms
Title:
Miscellaneous
Thread ID:
01283198
Message ID:
01285443
Views:
19
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
Map
View

Click here to load this message in the networking platform