Measure override and arrangeoverride of built-in types in WPF

Source: Internet
Author: User

Control (including contentcontrol) and contentpresenter

Measureoverride: uses the available space to measure the first visual tree subnode (call the measure (availablesize parameter) and returns the expected size of the member (desiredsize of the uielement ).

Arrangeoverride: place the first visual tree subnode view on the (0, 0) coordinate of the current final size (call arrange and use (0, 0, finalsize) as the parameter ).

 

Textblock

Measureoverride and arrangeoverride return the minimum size of the text (if both the height and width are double. Nan, the default value is as follows)

 

Adorner

Measureoverride: uses the display size of the modified object to measure the size of each sub-node in the visual tree (call the measure (adornedelement. rendersize) of each sub-node )).

Arrangeoverride: The adorner class does not override the arrangeoverride method of frameworkelement. Note: manually rewrite it in your custom adorner.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.