Skip to content

Add a MeasureUpdated event and look at deprecating SizeChanged for LayoutUpdated #23274

@PureWeen

Description

@PureWeen

Description

The SizeChanged event is called from the arrange pass on each platform. At the point that you're doing an arrange pass everything should have its proper size. If you modify the size of anything during the arrange pass it's going to trigger a new layout loop. We see a lot of patterns where people will listen to the SizeChanged event and then modify the size of something else based on this change. This is always going to trigger a second layout loop. This is also going to happen if users are binding to the Height/Width property on controls

Things to Investigate

  • Can we give an accurate size for the controls inside the measure loop?
  • We could just wire up to the platform sizechanged events and propagate these out as MeasureUpdated

Current workarounds

  • if you're curious to watch the SizeChanged of something to influence another control. Try inheriting from the control and overriding "MeasureOverride". Use the result of this to size other elements.

Metadata

Metadata

Assignees

Labels

area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or Elementperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)proposal/underconsiderations/triagedIssue has been reviewedt/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions