Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:16:41+00:00 2026-06-17T12:16:41+00:00

I am creating the custom control where i need to update the layout if

  • 0

I am creating the custom control where i need to update the layout if one of the Dependency property changes. I can use the FrameworkMetadataProperty.AffectsMeasure or FrameworkMetadataProperty.AffectsArrange.

Q.1 – I am confused which one to use.

Moreover I can also use the UpdateLayout and InvalidateVisual methods as well in order to update the UI.

Q.2 – All these 4 things looks similar and am confused on which one to use when?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:16:42+00:00Added an answer on June 17, 2026 at 12:16 pm

    First, the difference between setting FrameworkPropertyMetadataOptions and calling methods as UpdateLayout or InvalidateVisual is obvious. In the latter case you call these methods in your control code, wheras in the former case the appropriate methods are called by the framework.

    The difference between AffectsMeasure and AffectsArrange is simply that one results in a call to UIElement.InvalidateMeasure (“affects the measure pass of the layout”) and the other results in a call to UIElement.InvalidateArrange (“affects the arrange pass of the layout”).

    The difference becomes clear from the Remarks in UIElement.Measure:

    When a layout is first instantiated, it always receives a Measure call
    before Arrange. However, after the first layout pass, it may receive
    an Arrange call without a Measure; this can happen when a property
    that affects only Arrange is changed (such as alignment), or when the
    parent receives an Arrange without a Measure. A Measure call will
    automatically invalidate an Arrange call.

    and from the Remarks in UIElement.InvalidateMeasure:

    Calling this method also calls InvalidateArrange internally, there is
    no need to call InvalidateMeasure and InvalidateArrange in succession


    UPDATE: For the difference between UpdateLayout and InvalidateVisual, see the Remarks in UpdateLayout:

    When you call this method, elements with IsMeasureValid false or IsArrangeValid false
    will call element-specific MeasureCore and ArrangeCore methods, which forces
    layout update, and all computed sizes will be validated.

    Calling this method has no effect if layout is unchanged, or if
    neither arrangement nor measurement state of a layout is invalid.
    However, if layout is invalid in either respect, the UpdateLayout call
    will redo the entire layout. Therefore, you should avoid calling
    UpdateLayout after each incremental and minor change in the element
    tree. The layout system will perform element layout in a deferred
    manner, using an algorithm that balances performance and currency, and
    with a weighting strategy to defer changes to roots until all child
    elements are valid. You should only call UpdateLayout if you
    absolutely need updated sizes and positions, and only after you are
    certain that all changes to properties that you control and that may
    affect layout are completed.

    and in InvalidateVisual:

    This method calls InvalidateArrange internally.

    This method is not generally called from your application code. The
    WPF framework-level layout system does its own handling of changes in
    the visual tree of an element, and would be calling the equivalent of
    this method when necessary already. Calling this method is necessary
    only for advanced scenarios. One such advanced scenario is if you are
    creating a PropertyChangedCallback for a dependency property that is
    not on a Freezable or FrameworkElement derived class that still
    influences the layout when it changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating custom control and because I need to do lot's of binding inside
I am creating a custom server control with a property that accepts a String
I believe am in need of creating custom RichTextBox in C#. One kind of
I'm creating some custom FireMonkey GUI controls. The components need to update in response
I am creating a custom control and I need to handle some logic AFTER
I need help creating a .dll file from a custom control so that it
I'm creating a custom control in C# for a legacy application which only supports
I am creating a custom control. I want the template for this control to
I am creating a custom control. The contents of the control will differ a
I'm creating a custom script control in ASP.NET The purpose of the control is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.